| @@ 60-85 (lines=26) @@ | ||
| 57 | } |
|
| 58 | ||
| 59 | ||
| 60 | public function check_plugin_edit() { |
|
| 61 | $screen = get_current_screen(); |
|
| 62 | if ( 'plugin-editor' !== $screen->base || |
|
| 63 | ! isset( $_POST['action'] ) || |
|
| 64 | 'update' !== $_POST['action'] || |
|
| 65 | ! isset( $_POST['plugin'] ) |
|
| 66 | ) { |
|
| 67 | return; |
|
| 68 | } |
|
| 69 | ||
| 70 | $plugin = $_POST['plugin']; |
|
| 71 | $plugins = get_plugins(); |
|
| 72 | if ( ! isset( $plugins[ $plugin ] ) ) { |
|
| 73 | return; |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * Helps Sync log that a plugin was edited |
|
| 78 | * |
|
| 79 | * @since 4.9.0 |
|
| 80 | * |
|
| 81 | * @param string $plugin, Plugin slug |
|
| 82 | * @param mixed $plugins[ $plugin ], Array of plugin data |
|
| 83 | */ |
|
| 84 | do_action( 'jetpack_edited_plugin', $plugin, $plugins[ $plugin ] ); |
|
| 85 | } |
|
| 86 | ||
| 87 | public function check_plugin_edit2() { |
|
| 88 | $screen = get_current_screen(); |
|
| @@ 87-112 (lines=26) @@ | ||
| 84 | do_action( 'jetpack_edited_plugin', $plugin, $plugins[ $plugin ] ); |
|
| 85 | } |
|
| 86 | ||
| 87 | public function check_plugin_edit2() { |
|
| 88 | $screen = get_current_screen(); |
|
| 89 | if ( 'plugin-editor' !== $screen->base || |
|
| 90 | ! isset( $_GET['a'] ) || |
|
| 91 | ! 'te' === $_GET['a'] || |
|
| 92 | ! isset( $_GET['plugin'] ) |
|
| 93 | ) { |
|
| 94 | return; |
|
| 95 | } |
|
| 96 | ||
| 97 | $plugin = $_GET['plugin']; |
|
| 98 | $plugins = get_plugins(); |
|
| 99 | if ( ! isset( $plugins[ $plugin ] ) ) { |
|
| 100 | return; |
|
| 101 | } |
|
| 102 | ||
| 103 | /** |
|
| 104 | * Helps Sync log that a plugin was edited |
|
| 105 | * |
|
| 106 | * @since 4.9.0 |
|
| 107 | * |
|
| 108 | * @param string $plugin, Plugin slug |
|
| 109 | * @param mixed $plugins[ $plugin ], Array of plugin data |
|
| 110 | */ |
|
| 111 | do_action( 'jetpack_edited_plugin', $plugin, $plugins[ $plugin ] ); |
|
| 112 | } |
|
| 113 | ||
| 114 | public function delete_plugin( $plugin_path ) { |
|
| 115 | $full_plugin_path = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $plugin_path; |
|