1616 * Plugin Name: CBX PhpSpreadSheet Library
1717 * Plugin URI: https://codeboxr.com/php-spreadsheet-library-wordpress-plugin/
1818 * Description: A pure PHP library for reading and writing spreadsheet files https://phpspreadsheet.readthedocs.io/
19- * Version: 1.0.11
19+ * Version: 1.0.12
2020 * Requires PHP: 8.1.99
2121 * Author: Codeboxr
2222 * Author URI: https://github.com/PHPOffice/PhpSpreadsheet
3333}
3434
3535defined ( 'CBXPHPSPREADSHEET_PLUGIN_NAME ' ) or define ( 'CBXPHPSPREADSHEET_PLUGIN_NAME ' , 'cbxphpspreadsheet ' );
36- defined ( 'CBXPHPSPREADSHEET_PLUGIN_VERSION ' ) or define ( 'CBXPHPSPREADSHEET_PLUGIN_VERSION ' , '1.0.11 ' );
36+ defined ( 'CBXPHPSPREADSHEET_PLUGIN_VERSION ' ) or define ( 'CBXPHPSPREADSHEET_PLUGIN_VERSION ' , '1.0.12 ' );
3737defined ( 'CBXPHPSPREADSHEET_BASE_NAME ' ) or define ( 'CBXPHPSPREADSHEET_BASE_NAME ' , plugin_basename ( __FILE__ ) );
3838defined ( 'CBXPHPSPREADSHEET_ROOT_PATH ' ) or define ( 'CBXPHPSPREADSHEET_ROOT_PATH ' , plugin_dir_path ( __FILE__ ) );
3939defined ( 'CBXPHPSPREADSHEET_ROOT_URL ' ) or define ( 'CBXPHPSPREADSHEET_ROOT_URL ' , plugin_dir_url ( __FILE__ ) );
@@ -51,7 +51,7 @@ public function __construct() {
5151 add_action ( 'init ' , [ $ this , 'load_plugin_textdomain ' ]);
5252
5353 // Add custom row meta links
54- add_filter ( 'plugin_row_meta ' , [ $ this , 'plugin_row_meta ' ], 10 , 2 );
54+ add_filter ( 'plugin_row_meta ' , [ $ this , 'plugin_row_meta ' ], 10 , 4 );
5555 add_action ( 'admin_notices ' , [ $ this , 'activation_error_display ' ] );
5656
5757 add_filter ( 'pre_set_site_transient_update_plugins ' , [
@@ -144,27 +144,33 @@ private static function extension_check( $extensions ) {
144144 public static function environment_ready () {
145145 return self ::php_version_check () && self ::extension_check ( [ 'zip ' , 'xml ' , 'gd ' ]);
146146 }//end method environment_ready
147+
147148
148149 /**
149- * Add support and documentation links to the plugin row meta
150+ * Filters the array of row meta for each/specific plugin in the Plugins list table.
151+ * Appends additional links below each/specific plugin on the plugins page.
150152 *
151- * @param array $links
152- * @param string $file
153+ * @access public
153154 *
154- * @return array
155+ * @param array $links_array An array of the plugin's metadata
156+ * @param string $plugin_file_name Path to the plugin file
157+ * @param array $plugin_data An array of plugin data
158+ * @param string $status Status of the plugin
159+ *
160+ * @return array $links_array
155161 */
156- public function plugin_row_meta ( $ links , $ file ) {
157- if ( strpos ( $ file , 'cbxphpspreadsheet.php ' ) !== false ) {
158- $ new_links = [
159- 'support ' => '<a href="https://codeboxr.com/php-spreadsheet-library-wordpress-plugin/" target="_blank"> ' . esc_html__ ( 'Support ' , 'cbxphpspreadsheet ' ) . '</a> ' ,
160- 'doc ' => '<a href="https://phpspreadsheet.readthedocs.io/en/latest/" target="_blank"> ' . esc_html__ ( 'PHP Spreadsheet Doc ' , 'cbxphpspreadsheet ' ) . '</a> ' ,
161- ];
162+ public function plugin_row_meta ( $ links_array , $ plugin_file_name , $ plugin_data , $ status ) {
163+ if ( strpos ( $ plugin_file_name , CBXPHPSPREADSHEET_BASE_NAME ) !== false ) {
164+ if ( ! function_exists ( 'is_plugin_active ' ) ) {
165+ include_once ( ABSPATH . 'wp-admin/includes/plugin.php ' );
166+ }
162167
163- $ links = array_merge ( $ links , $ new_links );
168+ $ links_array [] = '<a target="_blank" style="color:#005ae0 !important; font-weight: bold;" href="https://github.com/codeboxrcodehub/cbxphpspreadsheet" aria-label=" ' . esc_attr__ ( 'Github Repo ' , 'cbxphpspreadsheet ' ) . '"> ' . esc_html__ ( 'Github Repo ' , 'cbxphpspreadsheet ' ) . '</a> ' ;
169+ $ links_array [] = '<a target="_blank" style="color:#005ae0 !important; font-weight: bold;" href="https://github.com/codeboxrcodehub/cbxphpspreadsheet/releases" aria-label=" ' . esc_attr__ ( 'Download ' , 'cbxphpspreadsheet ' ) . '"> ' . esc_html__ ( 'Download Latest ' , 'cbxphpspreadsheet ' ) . '</a> ' ;
164170 }
165171
166- return $ links ;
167- }
172+ return $ links_array ;
173+ }//end plugin_row_meta
168174
169175 /**
170176 * Load textdomain
0 commit comments