@@ -769,7 +769,7 @@ discard block |
||
| 769 | 769 | // All plugin information will be stored in an array for processing. |
| 770 | 770 | $slug = $this->sanitize_key( urldecode( $_GET['plugin'] ) ); |
| 771 | 771 | |
| 772 | - if ( ! isset( $this->plugins[ $slug ] ) ) { |
|
| 772 | + if ( ! isset( $this->plugins[$slug] ) ) { |
|
| 773 | 773 | return false; |
| 774 | 774 | } |
| 775 | 775 | |
@@ -814,7 +814,7 @@ discard block |
||
| 814 | 814 | $extra = array(); |
| 815 | 815 | $extra['slug'] = $slug; // Needed for potentially renaming of directory name. |
| 816 | 816 | $source = $this->get_download_url( $slug ); |
| 817 | - $api = ( 'repo' === $this->plugins[ $slug ]['source_type'] ) ? $this->get_plugins_api( $slug ) : null; |
|
| 817 | + $api = ( 'repo' === $this->plugins[$slug]['source_type'] ) ? $this->get_plugins_api( $slug ) : null; |
|
| 818 | 818 | $api = ( false !== $api ) ? $api : null; |
| 819 | 819 | |
| 820 | 820 | $url = add_query_arg( |
@@ -831,8 +831,8 @@ discard block |
||
| 831 | 831 | |
| 832 | 832 | $title = ( 'update' === $install_type ) ? $this->strings['updating'] : $this->strings['installing']; |
| 833 | 833 | $skin_args = array( |
| 834 | - 'type' => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload', |
|
| 835 | - 'title' => sprintf( $title, $this->plugins[ $slug ]['name'] ), |
|
| 834 | + 'type' => ( 'bundled' !== $this->plugins[$slug]['source_type'] ) ? 'web' : 'upload', |
|
| 835 | + 'title' => sprintf( $title, $this->plugins[$slug]['name'] ), |
|
| 836 | 836 | 'url' => esc_url_raw( $url ), |
| 837 | 837 | 'nonce' => $install_type . '-plugin_' . $slug, |
| 838 | 838 | 'plugin' => '', |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | unset( $title ); |
| 843 | 843 | |
| 844 | 844 | if ( 'update' === $install_type ) { |
| 845 | - $skin_args['plugin'] = $this->plugins[ $slug ]['file_path']; |
|
| 845 | + $skin_args['plugin'] = $this->plugins[$slug]['file_path']; |
|
| 846 | 846 | $skin = new Plugin_Upgrader_Skin( $skin_args ); |
| 847 | 847 | } else { |
| 848 | 848 | $skin = new Plugin_Installer_Skin( $skin_args ); |
@@ -857,12 +857,12 @@ discard block |
||
| 857 | 857 | if ( 'update' === $install_type ) { |
| 858 | 858 | // Inject our info into the update transient. |
| 859 | 859 | $to_inject = array( |
| 860 | - $slug => $this->plugins[ $slug ], |
|
| 860 | + $slug => $this->plugins[$slug], |
|
| 861 | 861 | ); |
| 862 | - $to_inject[ $slug ]['source'] = $source; |
|
| 862 | + $to_inject[$slug]['source'] = $source; |
|
| 863 | 863 | $this->inject_update_info( $to_inject ); |
| 864 | 864 | |
| 865 | - $upgrader->upgrade( $this->plugins[ $slug ]['file_path'] ); |
|
| 865 | + $upgrader->upgrade( $this->plugins[$slug]['file_path'] ); |
|
| 866 | 866 | } else { |
| 867 | 867 | $upgrader->install( $source ); |
| 868 | 868 | } |
@@ -892,11 +892,11 @@ discard block |
||
| 892 | 892 | } |
| 893 | 893 | |
| 894 | 894 | return true; |
| 895 | - } elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) { |
|
| 895 | + } elseif ( isset( $this->plugins[$slug]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) { |
|
| 896 | 896 | // Activate action link was clicked. |
| 897 | 897 | check_admin_referer( 'tgmpa-activate', 'tgmpa-nonce' ); |
| 898 | 898 | |
| 899 | - if ( false === $this->activate_single_plugin( $this->plugins[ $slug ]['file_path'], $slug ) ) { |
|
| 899 | + if ( false === $this->activate_single_plugin( $this->plugins[$slug]['file_path'], $slug ) ) { |
|
| 900 | 900 | return true; // Finish execution of the function early as we encountered an error. |
| 901 | 901 | } |
| 902 | 902 | } |
@@ -921,17 +921,17 @@ discard block |
||
| 921 | 921 | foreach ( $plugins as $slug => $plugin ) { |
| 922 | 922 | $file_path = $plugin['file_path']; |
| 923 | 923 | |
| 924 | - if ( empty( $repo_updates->response[ $file_path ] ) ) { |
|
| 925 | - $repo_updates->response[ $file_path ] = new stdClass(); |
|
| 924 | + if ( empty( $repo_updates->response[$file_path] ) ) { |
|
| 925 | + $repo_updates->response[$file_path] = new stdClass(); |
|
| 926 | 926 | } |
| 927 | 927 | |
| 928 | 928 | // We only really need to set package, but let's do all we can in case WP changes something. |
| 929 | - $repo_updates->response[ $file_path ]->slug = $slug; |
|
| 930 | - $repo_updates->response[ $file_path ]->plugin = $file_path; |
|
| 931 | - $repo_updates->response[ $file_path ]->new_version = $plugin['version']; |
|
| 932 | - $repo_updates->response[ $file_path ]->package = $plugin['source']; |
|
| 933 | - if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin['external_url'] ) ) { |
|
| 934 | - $repo_updates->response[ $file_path ]->url = $plugin['external_url']; |
|
| 929 | + $repo_updates->response[$file_path]->slug = $slug; |
|
| 930 | + $repo_updates->response[$file_path]->plugin = $file_path; |
|
| 931 | + $repo_updates->response[$file_path]->new_version = $plugin['version']; |
|
| 932 | + $repo_updates->response[$file_path]->package = $plugin['source']; |
|
| 933 | + if ( empty( $repo_updates->response[$file_path]->url ) && ! empty( $plugin['external_url'] ) ) { |
|
| 934 | + $repo_updates->response[$file_path]->url = $plugin['external_url']; |
|
| 935 | 935 | } |
| 936 | 936 | } |
| 937 | 937 | |
@@ -974,7 +974,7 @@ discard block |
||
| 974 | 974 | } else { |
| 975 | 975 | // Bulk installer contains less info, so fall back on the info registered here. |
| 976 | 976 | foreach ( $this->plugins as $slug => $plugin ) { |
| 977 | - if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin['name'] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) { |
|
| 977 | + if ( ! empty( $upgrader->skin->plugin_names[$upgrader->skin->i] ) && $plugin['name'] === $upgrader->skin->plugin_names[$upgrader->skin->i] ) { |
|
| 978 | 978 | $desired_slug = $slug; |
| 979 | 979 | break; |
| 980 | 980 | } |
@@ -1041,7 +1041,7 @@ discard block |
||
| 1041 | 1041 | // Make sure message doesn't display again if bulk activation is performed |
| 1042 | 1042 | // immediately after a single activation. |
| 1043 | 1043 | if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK. |
| 1044 | - echo '<div id="message" class="updated"><p>', esc_html( $this->strings['activated_successfully'] ), ' <strong>', esc_html( $this->plugins[ $slug ]['name'] ), '.</strong></p></div>'; |
|
| 1044 | + echo '<div id="message" class="updated"><p>', esc_html( $this->strings['activated_successfully'] ), ' <strong>', esc_html( $this->plugins[$slug]['name'] ), '.</strong></p></div>'; |
|
| 1045 | 1045 | } |
| 1046 | 1046 | } else { |
| 1047 | 1047 | // Simpler message layout for use on the plugin install page. |
@@ -1054,7 +1054,7 @@ discard block |
||
| 1054 | 1054 | echo '<div id="message" class="error"><p>', |
| 1055 | 1055 | sprintf( |
| 1056 | 1056 | esc_html( $this->strings['plugin_already_active'] ), |
| 1057 | - '<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>' |
|
| 1057 | + '<strong>' . esc_html( $this->plugins[$slug]['name'] ) . '</strong>' |
|
| 1058 | 1058 | ), |
| 1059 | 1059 | '</p></div>'; |
| 1060 | 1060 | } elseif ( $this->does_plugin_require_update( $slug ) ) { |
@@ -1065,13 +1065,13 @@ discard block |
||
| 1065 | 1065 | echo '<div id="message" class="error"><p>', |
| 1066 | 1066 | sprintf( |
| 1067 | 1067 | esc_html( $this->strings['plugin_needs_higher_version'] ), |
| 1068 | - '<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>' |
|
| 1068 | + '<strong>' . esc_html( $this->plugins[$slug]['name'] ) . '</strong>' |
|
| 1069 | 1069 | ), |
| 1070 | 1070 | '</p></div>'; |
| 1071 | 1071 | } |
| 1072 | 1072 | } else { |
| 1073 | 1073 | // Simpler message layout for use on the plugin install page. |
| 1074 | - echo '<p>', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[ $slug ]['name'] ) ), '</p>'; |
|
| 1074 | + echo '<p>', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[$slug]['name'] ) ), '</p>'; |
|
| 1075 | 1075 | } |
| 1076 | 1076 | } |
| 1077 | 1077 | |
@@ -1198,7 +1198,7 @@ discard block |
||
| 1198 | 1198 | $rendered .= sprintf( |
| 1199 | 1199 | $line_template, |
| 1200 | 1200 | sprintf( |
| 1201 | - translate_nooped_plural( $this->strings[ $type ], $count, 'tgmpa' ), |
|
| 1201 | + translate_nooped_plural( $this->strings[$type], $count, 'tgmpa' ), |
|
| 1202 | 1202 | $imploded, |
| 1203 | 1203 | $count |
| 1204 | 1204 | ) |
@@ -1315,7 +1315,7 @@ discard block |
||
| 1315 | 1315 | |
| 1316 | 1316 | foreach ( (array) $wp_settings_errors as $key => $details ) { |
| 1317 | 1317 | if ( 'tgmpa' === $details['setting'] ) { |
| 1318 | - unset( $wp_settings_errors[ $key ] ); |
|
| 1318 | + unset( $wp_settings_errors[$key] ); |
|
| 1319 | 1319 | break; |
| 1320 | 1320 | } |
| 1321 | 1321 | } |
@@ -1351,20 +1351,20 @@ discard block |
||
| 1351 | 1351 | return; |
| 1352 | 1352 | } |
| 1353 | 1353 | |
| 1354 | - if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) { |
|
| 1354 | + if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[$plugin['slug']] ) ) { |
|
| 1355 | 1355 | return; |
| 1356 | 1356 | } |
| 1357 | 1357 | |
| 1358 | 1358 | $defaults = array( |
| 1359 | - 'name' => '', // String |
|
| 1360 | - 'slug' => '', // String |
|
| 1361 | - 'source' => 'repo', // String |
|
| 1362 | - 'required' => false, // Boolean |
|
| 1363 | - 'version' => '', // String |
|
| 1364 | - 'force_activation' => false, // Boolean |
|
| 1365 | - 'force_deactivation' => false, // Boolean |
|
| 1366 | - 'external_url' => '', // String |
|
| 1367 | - 'is_callable' => '', // String|Array. |
|
| 1359 | + 'name' => '', // String |
|
| 1360 | + 'slug' => '', // String |
|
| 1361 | + 'source' => 'repo', // String |
|
| 1362 | + 'required' => false, // Boolean |
|
| 1363 | + 'version' => '', // String |
|
| 1364 | + 'force_activation' => false, // Boolean |
|
| 1365 | + 'force_deactivation' => false, // Boolean |
|
| 1366 | + 'external_url' => '', // String |
|
| 1367 | + 'is_callable' => '', // String|Array. |
|
| 1368 | 1368 | ); |
| 1369 | 1369 | |
| 1370 | 1370 | // Prepare the received data. |
@@ -1385,8 +1385,8 @@ discard block |
||
| 1385 | 1385 | $plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] ); |
| 1386 | 1386 | |
| 1387 | 1387 | // Set the class properties. |
| 1388 | - $this->plugins[ $plugin['slug'] ] = $plugin; |
|
| 1389 | - $this->sort_order[ $plugin['slug'] ] = $plugin['name']; |
|
| 1388 | + $this->plugins[$plugin['slug']] = $plugin; |
|
| 1389 | + $this->sort_order[$plugin['slug']] = $plugin['name']; |
|
| 1390 | 1390 | |
| 1391 | 1391 | // Should we add the force activation hook ? |
| 1392 | 1392 | if ( true === $plugin['force_activation'] ) { |
@@ -1470,11 +1470,11 @@ discard block |
||
| 1470 | 1470 | ); |
| 1471 | 1471 | |
| 1472 | 1472 | foreach ( $keys as $key ) { |
| 1473 | - if ( isset( $config[ $key ] ) ) { |
|
| 1474 | - if ( is_array( $config[ $key ] ) ) { |
|
| 1475 | - $this->$key = array_merge( $this->$key, $config[ $key ] ); |
|
| 1473 | + if ( isset( $config[$key] ) ) { |
|
| 1474 | + if ( is_array( $config[$key] ) ) { |
|
| 1475 | + $this->$key = array_merge( $this->$key, $config[$key] ); |
|
| 1476 | 1476 | } else { |
| 1477 | - $this->$key = $config[ $key ]; |
|
| 1477 | + $this->$key = $config[$key]; |
|
| 1478 | 1478 | } |
| 1479 | 1479 | } |
| 1480 | 1480 | } |
@@ -1519,12 +1519,12 @@ discard block |
||
| 1519 | 1519 | * Parameter added in v2.5.0. |
| 1520 | 1520 | */ |
| 1521 | 1521 | public function populate_file_path( $plugin_slug = '' ) { |
| 1522 | - if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) { |
|
| 1523 | - $this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug ); |
|
| 1522 | + if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[$plugin_slug] ) ) { |
|
| 1523 | + $this->plugins[$plugin_slug]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug ); |
|
| 1524 | 1524 | } else { |
| 1525 | 1525 | // Add file_path key for all plugins. |
| 1526 | 1526 | foreach ( $this->plugins as $slug => $values ) { |
| 1527 | - $this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug ); |
|
| 1527 | + $this->plugins[$slug]['file_path'] = $this->_get_plugin_basename_from_slug( $slug ); |
|
| 1528 | 1528 | } |
| 1529 | 1529 | } |
| 1530 | 1530 | } |
@@ -1564,8 +1564,8 @@ discard block |
||
| 1564 | 1564 | */ |
| 1565 | 1565 | public function _get_plugin_data_from_name( $name, $data = 'slug' ) { |
| 1566 | 1566 | foreach ( $this->plugins as $values ) { |
| 1567 | - if ( $name === $values['name'] && isset( $values[ $data ] ) ) { |
|
| 1568 | - return $values[ $data ]; |
|
| 1567 | + if ( $name === $values['name'] && isset( $values[$data] ) ) { |
|
| 1568 | + return $values[$data]; |
|
| 1569 | 1569 | } |
| 1570 | 1570 | } |
| 1571 | 1571 | |
@@ -1583,13 +1583,13 @@ discard block |
||
| 1583 | 1583 | public function get_download_url( $slug ) { |
| 1584 | 1584 | $dl_source = ''; |
| 1585 | 1585 | |
| 1586 | - switch ( $this->plugins[ $slug ]['source_type'] ) { |
|
| 1586 | + switch ( $this->plugins[$slug]['source_type'] ) { |
|
| 1587 | 1587 | case 'repo': |
| 1588 | 1588 | return $this->get_wp_repo_download_url( $slug ); |
| 1589 | 1589 | case 'external': |
| 1590 | - return $this->plugins[ $slug ]['source']; |
|
| 1590 | + return $this->plugins[$slug]['source']; |
|
| 1591 | 1591 | case 'bundled': |
| 1592 | - return $this->default_path . $this->plugins[ $slug ]['source']; |
|
| 1592 | + return $this->default_path . $this->plugins[$slug]['source']; |
|
| 1593 | 1593 | } |
| 1594 | 1594 | |
| 1595 | 1595 | return $dl_source; // Should never happen. |
@@ -1625,7 +1625,7 @@ discard block |
||
| 1625 | 1625 | protected function get_plugins_api( $slug ) { |
| 1626 | 1626 | static $api = array(); // Cache received responses. |
| 1627 | 1627 | |
| 1628 | - if ( ! isset( $api[ $slug ] ) ) { |
|
| 1628 | + if ( ! isset( $api[$slug] ) ) { |
|
| 1629 | 1629 | if ( ! function_exists( 'plugins_api' ) ) { |
| 1630 | 1630 | require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; |
| 1631 | 1631 | } |
@@ -1640,16 +1640,16 @@ discard block |
||
| 1640 | 1640 | ) |
| 1641 | 1641 | ); |
| 1642 | 1642 | |
| 1643 | - $api[ $slug ] = false; |
|
| 1643 | + $api[$slug] = false; |
|
| 1644 | 1644 | |
| 1645 | 1645 | if ( is_wp_error( $response ) ) { |
| 1646 | 1646 | wp_die( esc_html( $this->strings['oops'] ) ); |
| 1647 | 1647 | } else { |
| 1648 | - $api[ $slug ] = $response; |
|
| 1648 | + $api[$slug] = $response; |
|
| 1649 | 1649 | } |
| 1650 | 1650 | } |
| 1651 | 1651 | |
| 1652 | - return $api[ $slug ]; |
|
| 1652 | + return $api[$slug]; |
|
| 1653 | 1653 | } |
| 1654 | 1654 | |
| 1655 | 1655 | /** |
@@ -1662,13 +1662,13 @@ discard block |
||
| 1662 | 1662 | * or the plugin name if not. |
| 1663 | 1663 | */ |
| 1664 | 1664 | public function get_info_link( $slug ) { |
| 1665 | - if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ]['external_url'] ) ) { |
|
| 1665 | + if ( ! empty( $this->plugins[$slug]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[$slug]['external_url'] ) ) { |
|
| 1666 | 1666 | $link = sprintf( |
| 1667 | 1667 | '<a href="%1$s" target="_blank">%2$s</a>', |
| 1668 | - esc_url( $this->plugins[ $slug ]['external_url'] ), |
|
| 1669 | - esc_html( $this->plugins[ $slug ]['name'] ) |
|
| 1668 | + esc_url( $this->plugins[$slug]['external_url'] ), |
|
| 1669 | + esc_html( $this->plugins[$slug]['name'] ) |
|
| 1670 | 1670 | ); |
| 1671 | - } elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) { |
|
| 1671 | + } elseif ( 'repo' === $this->plugins[$slug]['source_type'] ) { |
|
| 1672 | 1672 | $url = add_query_arg( |
| 1673 | 1673 | array( |
| 1674 | 1674 | 'tab' => 'plugin-information', |
@@ -1683,10 +1683,10 @@ discard block |
||
| 1683 | 1683 | $link = sprintf( |
| 1684 | 1684 | '<a href="%1$s" class="thickbox">%2$s</a>', |
| 1685 | 1685 | esc_url( $url ), |
| 1686 | - esc_html( $this->plugins[ $slug ]['name'] ) |
|
| 1686 | + esc_html( $this->plugins[$slug]['name'] ) |
|
| 1687 | 1687 | ); |
| 1688 | 1688 | } else { |
| 1689 | - $link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink. |
|
| 1689 | + $link = esc_html( $this->plugins[$slug]['name'] ); // No hyperlink. |
|
| 1690 | 1690 | } |
| 1691 | 1691 | |
| 1692 | 1692 | return $link; |
@@ -1811,7 +1811,7 @@ discard block |
||
| 1811 | 1811 | public function is_plugin_installed( $slug ) { |
| 1812 | 1812 | $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). |
| 1813 | 1813 | |
| 1814 | - return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) ); |
|
| 1814 | + return ( ! empty( $installed_plugins[$this->plugins[$slug]['file_path']] ) ); |
|
| 1815 | 1815 | } |
| 1816 | 1816 | |
| 1817 | 1817 | /** |
@@ -1823,7 +1823,7 @@ discard block |
||
| 1823 | 1823 | * @return bool True if active, false otherwise. |
| 1824 | 1824 | */ |
| 1825 | 1825 | public function is_plugin_active( $slug ) { |
| 1826 | - return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) ); |
|
| 1826 | + return ( ( ! empty( $this->plugins[$slug]['is_callable'] ) && is_callable( $this->plugins[$slug]['is_callable'] ) ) || is_plugin_active( $this->plugins[$slug]['file_path'] ) ); |
|
| 1827 | 1827 | } |
| 1828 | 1828 | |
| 1829 | 1829 | /** |
@@ -1837,7 +1837,7 @@ discard block |
||
| 1837 | 1837 | */ |
| 1838 | 1838 | public function can_plugin_update( $slug ) { |
| 1839 | 1839 | // We currently can't get reliable info on non-WP-repo plugins - issue #380. |
| 1840 | - if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { |
|
| 1840 | + if ( 'repo' !== $this->plugins[$slug]['source_type'] ) { |
|
| 1841 | 1841 | return true; |
| 1842 | 1842 | } |
| 1843 | 1843 | |
@@ -1893,8 +1893,8 @@ discard block |
||
| 1893 | 1893 | public function get_installed_version( $slug ) { |
| 1894 | 1894 | $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). |
| 1895 | 1895 | |
| 1896 | - if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) { |
|
| 1897 | - return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version']; |
|
| 1896 | + if ( ! empty( $installed_plugins[$this->plugins[$slug]['file_path']]['Version'] ) ) { |
|
| 1897 | + return $installed_plugins[$this->plugins[$slug]['file_path']]['Version']; |
|
| 1898 | 1898 | } |
| 1899 | 1899 | |
| 1900 | 1900 | return ''; |
@@ -1910,7 +1910,7 @@ discard block |
||
| 1910 | 1910 | */ |
| 1911 | 1911 | public function does_plugin_require_update( $slug ) { |
| 1912 | 1912 | $installed_version = $this->get_installed_version( $slug ); |
| 1913 | - $minimum_version = $this->plugins[ $slug ]['version']; |
|
| 1913 | + $minimum_version = $this->plugins[$slug]['version']; |
|
| 1914 | 1914 | |
| 1915 | 1915 | return version_compare( $minimum_version, $installed_version, '>' ); |
| 1916 | 1916 | } |
@@ -1925,9 +1925,9 @@ discard block |
||
| 1925 | 1925 | */ |
| 1926 | 1926 | public function does_plugin_have_update( $slug ) { |
| 1927 | 1927 | // Presume bundled and external plugins will point to a package which meets the minimum required version. |
| 1928 | - if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { |
|
| 1928 | + if ( 'repo' !== $this->plugins[$slug]['source_type'] ) { |
|
| 1929 | 1929 | if ( $this->does_plugin_require_update( $slug ) ) { |
| 1930 | - return $this->plugins[ $slug ]['version']; |
|
| 1930 | + return $this->plugins[$slug]['version']; |
|
| 1931 | 1931 | } |
| 1932 | 1932 | |
| 1933 | 1933 | return false; |
@@ -1935,8 +1935,8 @@ discard block |
||
| 1935 | 1935 | |
| 1936 | 1936 | $repo_updates = get_site_transient( 'update_plugins' ); |
| 1937 | 1937 | |
| 1938 | - if ( isset( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version ) ) { |
|
| 1939 | - return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version; |
|
| 1938 | + if ( isset( $repo_updates->response[$this->plugins[$slug]['file_path']]->new_version ) ) { |
|
| 1939 | + return $repo_updates->response[$this->plugins[$slug]['file_path']]->new_version; |
|
| 1940 | 1940 | } |
| 1941 | 1941 | |
| 1942 | 1942 | return false; |
@@ -1952,14 +1952,14 @@ discard block |
||
| 1952 | 1952 | */ |
| 1953 | 1953 | public function get_upgrade_notice( $slug ) { |
| 1954 | 1954 | // We currently can't get reliable info on non-WP-repo plugins - issue #380. |
| 1955 | - if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { |
|
| 1955 | + if ( 'repo' !== $this->plugins[$slug]['source_type'] ) { |
|
| 1956 | 1956 | return ''; |
| 1957 | 1957 | } |
| 1958 | 1958 | |
| 1959 | 1959 | $repo_updates = get_site_transient( 'update_plugins' ); |
| 1960 | 1960 | |
| 1961 | - if ( ! empty( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice ) ) { |
|
| 1962 | - return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice; |
|
| 1961 | + if ( ! empty( $repo_updates->response[$this->plugins[$slug]['file_path']]->upgrade_notice ) ) { |
|
| 1962 | + return $repo_updates->response[$this->plugins[$slug]['file_path']]->upgrade_notice; |
|
| 1963 | 1963 | } |
| 1964 | 1964 | |
| 1965 | 1965 | return ''; |
@@ -2043,7 +2043,7 @@ discard block |
||
| 2043 | 2043 | */ |
| 2044 | 2044 | if ( true === $plugin['force_deactivation'] && is_plugin_active( $plugin['file_path'] ) ) { |
| 2045 | 2045 | deactivate_plugins( $plugin['file_path'] ); |
| 2046 | - $deactivated[ $plugin['file_path'] ] = time(); |
|
| 2046 | + $deactivated[$plugin['file_path']] = time(); |
|
| 2047 | 2047 | } |
| 2048 | 2048 | } |
| 2049 | 2049 | |