| @@ -15,25 +15,26 @@ | ||
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Add meta to plugin details |
| 18 | 18 | * |
| 19 | - * Add options to plugin meta line | |
| 19 | + * Add options to plugin meta line. | |
| 20 | 20 | * |
| 21 | - * @version 1.1 | |
| 22 | - * @param string $links Current links. | |
| 21 | + * Internal code version: 1.3 | |
| 22 | + * | |
| 23 | + * @param array $links Current links. | |
| 23 | 24 | * @param string $file File in use. |
| 24 | - * @return string Links, now with settings added. | |
| 25 | + * @return array Links, now with settings added. | |
| 25 | 26 | */ |
| 26 | 27 | function sec_plugin_meta( $links, $file ) { |
| 27 | 28 | |
| 28 | - if ( false !== strpos( $file, 'simple-code-embed.php' ) ) { | |
| 29 | + if ( CODE_EMBED_PLUGIN_BASE === $file ) { | |
| 29 | 30 | |
| 30 | 31 | $links = array_merge( |
| 31 | 32 | $links, |
| 32 | - array( '<a href="https://github.com/dartiss/code-embed">' . __( 'Github', 'simple-embed-code' ) . '</a>' ), | |
| 33 | - array( '<a href="https://wordpress.org/support/plugin/simple-embed-code">' . __( 'Support', 'simple-embed-code' ) . '</a>' ), | |
| 34 | - array( '<a href="https://artiss.blog/donate">' . __( 'Donate', 'simple-embed-code' ) . '</a>' ), | |
| 35 | - array( '<a href="https://wordpress.org/support/plugin/simple-embed-code/reviews/?filter=5" title="' . __( 'Rate the plugin on WordPress.org', 'simple-embed-code' ) . '" style="color: #ffb900">' . str_repeat( '<span class="dashicons dashicons-star-filled" style="font-size: 16px; width:16px; height: 16px"></span>', 5 ) . '</a>' ), | |
| 33 | + array( '<a href="' . esc_url( 'https://github.com/dartiss/code-embed' ) . '">' . __( 'Github', 'simple-embed-code' ) . '</a>' ), | |
| 34 | + array( '<a href="' . esc_url( 'https://wordpress.org/support/plugin/simple-embed-code' ) . '">' . __( 'Support', 'simple-embed-code' ) . '</a>' ), | |
| 35 | + array( '<a href="' . esc_url( 'https://wordpress.org/support/plugin/simple-embed-code/reviews/' ) . '">' . __( 'Write a Review', 'simple-embed-code' ) . '</a>' ), | |
| 36 | + array( '<a href="' . esc_url( 'https://artiss.blog/donate' ) . '">' . __( 'Donate', 'simple-embed-code' ) . '</a>' ), | |
| 36 | 37 | ); |
| 37 | 38 | } |
| 38 | 39 | |
| 39 | 40 | return $links; |
| @@ -41,25 +42,26 @@ | ||
| 41 | 42 | |
| 42 | 43 | add_filter( 'plugin_row_meta', 'sec_plugin_meta', 10, 2 ); |
| 43 | 44 | |
| 44 | 45 | /** |
| 45 | - * Modify actions links. | |
| 46 | + * Modify action links. | |
| 46 | 47 | * |
| 47 | - * Add or remove links for the actions listed against this plugin | |
| 48 | + * Add links for the actions listed against this plugin. | |
| 48 | 49 | * |
| 49 | - * @version 1.1 | |
| 50 | - * @param string $actions Current actions. | |
| 50 | + * Internal code version: 1.1 | |
| 51 | + * | |
| 52 | + * @param array $actions Current actions. | |
| 51 | 53 | * @param string $plugin_file The plugin. |
| 52 | - * @return string Actions, now with deactivation removed! | |
| 54 | + * @return array List of plugin actions. | |
| 53 | 55 | */ |
| 54 | 56 | function sec_action_links( $actions, $plugin_file ) { |
| 55 | 57 | |
| 56 | 58 | // Make sure we only perform actions for this specific plugin! |
| 57 | - if ( strpos( $plugin_file, 'simple-code-embed.php' ) !== false ) { | |
| 59 | + if ( CODE_EMBED_PLUGIN_BASE === $plugin_file ) { | |
| 58 | 60 | |
| 59 | 61 | // Add link to the settings page. |
| 60 | 62 | if ( current_user_can( 'manage_options' ) ) { |
| 61 | - array_unshift( $actions, '<a href="admin.php?page=ce-options">' . __( 'Settings', 'simple-embed-code' ) . '</a>' ); | |
| 63 | + array_unshift( $actions, '<a href="' . admin_url( 'options-general.php?page=ce-options' ) . '">' . __( 'Settings', 'simple-embed-code' ) . '</a>' ); | |
| 62 | 64 | } |
| 63 | 65 | } |
| 64 | 66 | |
| 65 | 67 | return $actions; |
| @@ -71,9 +73,9 @@ | ||
| 71 | 73 | * WordPress Requirements Check |
| 72 | 74 | * |
| 73 | 75 | * Deactivate the plugin if certain requirements are not met. |
| 74 | 76 | * |
| 75 | - * @version 1.1 | |
| 77 | + * Internal code version: 1.1 | |
| 76 | 78 | */ |
| 77 | 79 | function sec_requirements_check() { |
| 78 | 80 | |
| 79 | 81 | $reason = ''; |
| @@ -97,14 +99,14 @@ | ||
| 97 | 99 | if ( '' !== $reason ) { |
| 98 | 100 | |
| 99 | 101 | // Deactivate this plugin. |
| 100 | 102 | |
| 101 | - deactivate_plugins( PLUGIN_NAME_PLUGIN_BASE ); | |
| 103 | + deactivate_plugins( CODE_EMBED_PLUGIN_BASE ); | |
| 102 | 104 | |
| 103 | 105 | // Set up a message and output it via wp_die. |
| 104 | 106 | |
| 105 | 107 | /* translators: 1: The plugin name. */ |
| 106 | - $message = '<p><b>' . sprintf( __( '%1$s has been deactivated', 'simple-embed-code' ), $name ) . '</b></p><p>' . __( 'Reason:', 'simple-embed-code' ) . '</p><ul>' . $reason . '</ul>'; | |
| 108 | + $message = '<p><strong>' . sprintf( __( '%1$s has been deactivated', 'simple-embed-code' ), $name ) . '</strong></p><p>' . __( 'Reason:', 'simple-embed-code' ) . '</p><ul>' . $reason . '</ul>'; | |
| 107 | 109 | |
| 108 | 110 | $allowed = array( |
| 109 | 111 | 'p' => array(), |
| 110 | 112 | 'b' => array(), |