| 1 |
<?php if ( ! defined( 'ABSPATH' ) ) exit; |
| 2 |
add_thickbox(); |
| 3 |
include( ABSPATH . "wp-admin/includes/plugin-install.php" ); |
| 4 |
global $tabs, $tab, $paged, $type, $term; |
| 5 |
$tabs = array(); |
| 6 |
$tab = "search"; |
| 7 |
$per_page = 30; |
| 8 |
$args = array |
| 9 |
( |
| 10 |
"user"=> "wpcalc", |
| 11 |
"page" => $paged, |
| 12 |
"per_page" => $per_page, |
| 13 |
"fields" => array( "last_updated" => true, "icons" => true, "active_installs" => true ), |
| 14 |
"locale" => get_locale(), |
| 15 |
); |
| 16 |
$args = apply_filters( "install_plugins_table_api_args_$tab", $args ); |
| 17 |
$api = plugins_api( "query_plugins", $args ); |
| 18 |
$item = $api->plugins; |
| 19 |
$plugins_allowedtags = array( |
| 20 |
'a' => array( 'href' => array(), 'title' => array(), 'target' => array() ), |
| 21 |
'abbr' => array( 'title' => array() ), 'acronym' => array( 'title' => array() ), |
| 22 |
'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(), |
| 23 |
'div' => array( 'class' => array() ), 'span' => array( 'class' => array() ), |
| 24 |
'p' => array(), 'ul' => array(), 'ol' => array(), 'li' => array(), |
| 25 |
'h1' => array(), 'h2' => array(), 'h3' => array(), 'h4' => array(), 'h5' => array(), 'h6' => array(), |
| 26 |
'img' => array( 'src' => array(), 'class' => array(), 'alt' => array() ) |
| 27 |
); |
| 28 |
?> |
| 29 |
<form id="plugin-filter"> |
| 30 |
<div class="wrap about-wrap wow-icons"> |
| 31 |
<p style="padding-bottom: 5px;margin-bottom:30px;"><span class="dashicons dashicons-megaphone"></span> <?php _e( 'Several plugins below is free and you can install it and hopefully useful. Enjoy it!', 'wow-icons' ); ?></p> |
| 32 |
<div class="wp-list-table widefat plugin-install"> |
| 33 |
<div id="the-list"> |
| 34 |
<?php |
| 35 |
foreach ( ( array ) $item as $plugin ) { |
| 36 |
if ( is_object( $plugin ) ) { |
| 37 |
$plugin = ( array ) $plugin; |
| 38 |
} |
| 39 |
$title = wp_kses( $plugin['name'], $plugins_allowedtags ); |
| 40 |
// Remove any HTML from the description. |
| 41 |
$description = strip_tags( $plugin['short_description'] ); |
| 42 |
$version = wp_kses( $plugin['version'], $plugins_allowedtags ); |
| 43 |
$name = strip_tags( $title . ' ' . $version ); |
| 44 |
$author = wp_kses( $plugin['author'], $plugins_allowedtags ); |
| 45 |
if ( ! empty( $author ) ) { |
| 46 |
$author = ' <cite>' . sprintf( __( 'By %s' ), $author ) . '</cite>'; |
| 47 |
} |
| 48 |
$action_links = array(); |
| 49 |
if ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) { |
| 50 |
$status = install_plugin_install_status( $plugin ); |
| 51 |
switch ( $status['status'] ) { |
| 52 |
case 'install': |
| 53 |
if ( $status['url'] ) { |
| 54 |
/* translators: 1: Plugin name and version. */ |
| 55 |
$action_links[] = '<a class="install-now button-secondary wow-button-install" href="' . $status['url'] . '" aria-label="' . esc_attr( sprintf( __( 'Install %s now' ), $name ) ) . '">' . __( 'Install Now' ) . '</a>'; |
| 56 |
} |
| 57 |
break; |
| 58 |
case 'update_available': |
| 59 |
if ( $status['url'] ) { |
| 60 |
/* translators: 1: Plugin name and version */ |
| 61 |
$action_links[] = '<a class="button wow-button-update" href="' . $status['url'] . '" aria-label="' . esc_attr( sprintf( __( 'Update %s now' ), $name ) ) . '">' . __( 'Update Now' ) . '</a>'; |
| 62 |
} |
| 63 |
break; |
| 64 |
case 'latest_installed': |
| 65 |
case 'newer_installed': |
| 66 |
$action_links[] = '<span class="button button-disabled" title="' . esc_attr__( 'This plugin is already installed and is up to date' ) . ' ">' . _x( 'Installed', 'plugin' ) . '</span>'; |
| 67 |
break; |
| 68 |
} |
| 69 |
} |
| 70 |
$details_link = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin['slug'] . |
| 71 |
'&TB_iframe=true&width=750&height=550' ); |
| 72 |
/* translators: 1: Plugin name and version. */ |
| 73 |
$action_links[] = '<a href="' . esc_url( $details_link ) . '" class="thickbox" aria-label="' . esc_attr( sprintf( __( 'More information about %s' ), $name ) ) . '" data-title="' . esc_attr( $name ) . '">' . __( 'More Details' ) . '</a>'; |
| 74 |
if ( !empty( $plugin['icons']['svg'] ) ) { |
| 75 |
$plugin_icon_url = $plugin['icons']['svg']; |
| 76 |
} elseif ( !empty( $plugin['icons']['2x'] ) ) { |
| 77 |
$plugin_icon_url = $plugin['icons']['2x']; |
| 78 |
} elseif ( !empty( $plugin['icons']['1x'] ) ) { |
| 79 |
$plugin_icon_url = $plugin['icons']['1x']; |
| 80 |
} else { |
| 81 |
$plugin_icon_url = $plugin['icons']['default']; |
| 82 |
} |
| 83 |
/** |
| 84 |
* Filter the install action links for a plugin. |
| 85 |
* |
| 86 |
* @since 2.7.0 |
| 87 |
* |
| 88 |
* @param array $action_links An array of plugin action hyperlinks. Defaults are links to Details and Install Now. |
| 89 |
* @param array $plugin The plugin currently being listed. |
| 90 |
*/ |
| 91 |
$action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin ); |
| 92 |
?> |
| 93 |
<div class="plugin-card"> |
| 94 |
<div class="plugin-card-top" style="min-height: 160px !important;"> |
| 95 |
<?php if ( isset( $plugin["slug"] ) && $plugin["slug"] == 'modal-window' ) {echo '<div class="most_popular"></div>';} ?> |
| 96 |
<a href="<?php echo esc_url( $details_link ); ?>" class="thickbox plugin-icon"><img width="128" height="128" src="<?php echo esc_attr( $plugin_icon_url ) ?>" /></a> |
| 97 |
<div class="name column-name" style="margin-right: 20px !important;"> |
| 98 |
<h3><a href="<?php echo esc_url( $details_link ); ?>" class="thickbox"><?php echo $title; ?></a></h3> |
| 99 |
</div> |
| 100 |
<div class="desc column-description" style="margin-right: 20px !important;"> |
| 101 |
<p><?php echo $description; ?></p> |
| 102 |
<p class="authors"><?php echo $author; ?></p> |
| 103 |
</div> |
| 104 |
</div> |
| 105 |
<div class="wow-button-con"> |
| 106 |
<?php |
| 107 |
if ( $action_links ) { |
| 108 |
echo '<ul class="wow-plugin-action-buttons">'; |
| 109 |
echo '<li>' . $action_links[0] . '</li>'; |
| 110 |
switch( $plugin["slug"] ){ |
| 111 |
case "modal-window" : |
| 112 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/wow-modal-windows-pro/" target="_blank">PRO VERSION</a></li>'; |
| 113 |
break; |
| 114 |
case "side-menu" : |
| 115 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/wow-side-menus-pro/" target="_blank">PRO VERSION</a></li>'; |
| 116 |
break; |
| 117 |
case "mwp-countdown" : |
| 118 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/wow-countdowns-pro/" target="_blank">PRO VERSION</a></li>'; |
| 119 |
break; |
| 120 |
case "forms-creator" : |
| 121 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/wow-forms-pro/" target="_blank">PRO VERSION</a></li>'; |
| 122 |
break; |
| 123 |
case "popups-creator" : |
| 124 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/wow-modal-windows-pro/" target="_blank">PRO VERSION</a></li>'; |
| 125 |
break; |
| 126 |
case "mwp-skype" : |
| 127 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/wow-skype-buttons-pro/" target="_blank">PRO VERSION</a></li>'; |
| 128 |
break; |
| 129 |
case "viral-signup" : |
| 130 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/wow-viral-signups-pro/" target="_blank">PRO VERSION</a></li>'; |
| 131 |
break; |
| 132 |
case "wow-facebook-login" : |
| 133 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/wow-facebook-login-pro/" target="_blank">PRO VERSION</a></li>'; |
| 134 |
break; |
| 135 |
case "wow-google-login" : |
| 136 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/wow-google-login-pro/" target="_blank">PRO VERSION</a></li>'; |
| 137 |
break; |
| 138 |
case "mwp-herd-effect" : |
| 139 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/wow-herd-effects-pro/" target="_blank">PRO VERSION</a></li>'; |
| 140 |
break; |
| 141 |
case "wow-icons" : |
| 142 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/wow-icons-pro/" target="_blank">PRO VERSION</a></li>'; |
| 143 |
break; |
| 144 |
case "bubble-menu" : |
| 145 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/bubble-menu-pro/" target="_blank">PRO VERSION</a></li>'; |
| 146 |
break; |
| 147 |
case "border-menu" : |
| 148 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/border-menu-pro/" target="_blank">PRO VERSION</a></li>'; |
| 149 |
break; |
| 150 |
case "slide-menu" : |
| 151 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/slide-menu-pro/" target="_blank">PRO VERSION</a></li>'; |
| 152 |
break; |
| 153 |
case "vertical-icon-menu" : |
| 154 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/vertical-icon-menu-pro/" target="_blank">PRO VERSION</a></li>'; |
| 155 |
break; |
| 156 |
case "float-menu" : |
| 157 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/float-menu-pro/" target="_blank">PRO VERSION</a></li>'; |
| 158 |
break; |
| 159 |
case "wpcalc" : |
| 160 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/wow-forms-pro/" target="_blank">PRO VERSION</a></li>'; |
| 161 |
break; |
| 162 |
case "mwp-forms" : |
| 163 |
echo '<li><a class="button-pro" aria-label="PRO VERSION" href="https://wow-estore.com/item/wow-forms-pro/" target="_blank">PRO VERSION</a></li>'; |
| 164 |
break; |
| 165 |
default: |
| 166 |
break; |
| 167 |
} |
| 168 |
echo '</ul>'; |
| 169 |
} |
| 170 |
?> |
| 171 |
</div> |
| 172 |
<div class="plugin-card-bottom"> |
| 173 |
<div class="vers column-rating"> |
| 174 |
<?php wp_star_rating( array( 'rating' => $plugin['rating'], 'type' => 'percent', 'number' => $plugin['num_ratings'] ) ); ?> |
| 175 |
<span class="num-ratings" aria-hidden="true">(<?php echo number_format_i18n( $plugin['num_ratings'] ); ?>)</span> |
| 176 |
</div> |
| 177 |
<div class="column-updated"> |
| 178 |
<strong><?php _e( 'Last Updated:' ); ?></strong> <span title="<?php echo esc_attr( $plugin['last_updated'] ); ?>"> |
| 179 |
<?php printf( __( '%s ago' ), human_time_diff( strtotime( $plugin['last_updated'] ) ) ); ?> |
| 180 |
</span> |
| 181 |
</div> |
| 182 |
<div class="column-downloaded"> |
| 183 |
<?php |
| 184 |
if ( $plugin['active_installs'] >= 1000000 ) { |
| 185 |
$active_installs_text = _x( '1+ Million', 'Active plugin installs' ); |
| 186 |
} elseif ( 0 == $plugin['active_installs'] ) { |
| 187 |
$active_installs_text = _x( 'Less Than 10', 'Active plugin installs' ); |
| 188 |
} else { |
| 189 |
$active_installs_text = number_format_i18n( $plugin['active_installs'] ) . '+'; |
| 190 |
} |
| 191 |
printf( __( '%s Active Installs' ), $active_installs_text ); |
| 192 |
?> |
| 193 |
</div> |
| 194 |
<div class="column-compatibility"> |
| 195 |
<?php |
| 196 |
if ( ! empty( $plugin['tested'] ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $plugin['tested'] ) ), $plugin['tested'], '>' ) ) { |
| 197 |
echo '<span class="compatibility-untested">' . __( 'Untested with your version of WordPress' ) . '</span>'; |
| 198 |
} elseif ( ! empty( $plugin['requires'] ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $plugin['requires'] ) ), $plugin['requires'], '<' ) ) { |
| 199 |
echo '<span class="compatibility-incompatible">' . __( '<strong>Incompatible</strong> with your version of WordPress' ) . '</span>'; |
| 200 |
} else { |
| 201 |
echo '<span class="compatibility-compatible">' . __( '<strong>Compatible</strong> with your version of WordPress' ) . '</span>'; |
| 202 |
} |
| 203 |
?> |
| 204 |
</div> |
| 205 |
</div> |
| 206 |
</div> |
| 207 |
<?php |
| 208 |
} |
| 209 |
?> |
| 210 |
</div> |
| 211 |
</div> |
| 212 |
</div> |
| 213 |
</form> |