|
|
|
@ -1,14 +1,14 @@
|
|
|
|
|
<?php |
|
|
|
|
if ( ! class_exists( 'WPcleverMenu' ) ) { |
|
|
|
|
class WPcleverMenu { |
|
|
|
|
if ( ! class_exists( 'WPCleverMenu' ) ) { |
|
|
|
|
class WPCleverMenu { |
|
|
|
|
function __construct() { |
|
|
|
|
add_action( 'admin_menu', array( $this, 'admin_menu' ) ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function admin_menu() { |
|
|
|
|
add_menu_page( |
|
|
|
|
'WPclever', |
|
|
|
|
'WP⚡clever', |
|
|
|
|
'WPClever', |
|
|
|
|
'WPClever⚡', |
|
|
|
|
'manage_options', |
|
|
|
|
'wpclever', |
|
|
|
|
array( &$this, 'welcome_content' ), |
|
|
|
@ -21,11 +21,13 @@ if ( ! class_exists( 'WPcleverMenu' ) ) {
|
|
|
|
|
function welcome_content() { |
|
|
|
|
?> |
|
|
|
|
<div class="wpclever_welcome_page wrap"> |
|
|
|
|
<h1>WPclever.net</h1> |
|
|
|
|
<h1>WPClever.net</h1> |
|
|
|
|
<div class="card"> |
|
|
|
|
<h2 class="title">Welcome</h2> |
|
|
|
|
<h2 class="title">About</h2> |
|
|
|
|
<p> |
|
|
|
|
Thanks for choosing our plugins for your website! |
|
|
|
|
We are a team of passionate developers of plugins for WordPress, whose aspiration is to bring |
|
|
|
|
smart utilities and functionalities to life for WordPress users, especially for those on |
|
|
|
|
WooCommerce platform. |
|
|
|
|
</p> |
|
|
|
|
</div> |
|
|
|
|
<div class="card wpclever_plugins"> |
|
|
|
@ -34,7 +36,7 @@ if ( ! class_exists( 'WPcleverMenu' ) ) {
|
|
|
|
|
if ( false === ( $plugins_arr = get_transient( 'wpclever_plugins' ) ) ) { |
|
|
|
|
$args = (object) array( |
|
|
|
|
'author' => 'wpclever', |
|
|
|
|
'per_page' => '20', |
|
|
|
|
'per_page' => '120', |
|
|
|
|
'page' => '1', |
|
|
|
|
'fields' => array( 'slug', 'name', 'version', 'downloaded', 'active_installs' ) |
|
|
|
|
); |
|
|
|
@ -65,8 +67,10 @@ if ( ! class_exists( 'WPcleverMenu' ) ) {
|
|
|
|
|
} |
|
|
|
|
if ( is_array( $plugins_arr ) && ( count( $plugins_arr ) > 0 ) ) { |
|
|
|
|
array_multisort( array_column( $plugins_arr, 'active_installs' ), SORT_DESC, $plugins_arr ); |
|
|
|
|
$i = 1; |
|
|
|
|
foreach ( $plugins_arr as $pl ) { |
|
|
|
|
echo '<div class="item"><a href="https://wordpress.org/plugins/' . $pl['slug'] . '/"><img src="https://ps.w.org/' . $pl['slug'] . '/assets/icon-128x128.png?t=' . current_time( 'd' ) . '"/><span class="title">' . $pl['name'] . '</span><br/><span class="info">Version ' . $pl['version'] . '</span></a></div>'; |
|
|
|
|
echo '<div class="item"><a href="https://wordpress.org/plugins/' . $pl['slug'] . '/"><span class="num">' . $i . '</span><span class="title">' . $pl['name'] . '</span><br/><span class="info">Version ' . $pl['version'] . '</span></a></div>'; |
|
|
|
|
$i ++; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
echo 'https://wpclever.net'; |
|
|
|
@ -76,9 +80,12 @@ if ( ! class_exists( 'WPcleverMenu' ) ) {
|
|
|
|
|
<div class="card"> |
|
|
|
|
<h2 class="title">Contact</h2> |
|
|
|
|
<p> |
|
|
|
|
Feel free to contact us via <a href="https://wpclever.net/contact" target="_blank">contact |
|
|
|
|
Feel free to contact us via <a |
|
|
|
|
href="https://wpclever.net/contact?utm_source=contact&utm_medium=menu&utm_campaign=wporg" |
|
|
|
|
target="_blank">contact |
|
|
|
|
page</a> :)<br/> |
|
|
|
|
Website: <a href="https://wpclever.net" target="_blank">https://wpclever.net</a> |
|
|
|
|
Website: <a href="https://wpclever.net?utm_source=visit&utm_medium=menu&utm_campaign=wporg" |
|
|
|
|
target="_blank">https://wpclever.net</a> |
|
|
|
|
</p> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -86,5 +93,5 @@ if ( ! class_exists( 'WPcleverMenu' ) ) {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
new WPcleverMenu(); |
|
|
|
|
new WPCleverMenu(); |
|
|
|
|
} |