Skip to content

Commit cf38cb7

Browse files
committed
version 1.0.4 released
1 parent 896fde3 commit cf38cb7

File tree

3 files changed

+46
-38
lines changed

3 files changed

+46
-38
lines changed

cbxphpfpdf.php

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Plugin Name: CBX PHPFPDF Library
1717
* Plugin URI: https://github.com/codeboxrcodehub/cbxphpfpdf
1818
* Description: fpdf library as WordPress plugin based on https://github.com/fawno/FPDF
19-
* Version: 1.0.3
19+
* Version: 1.0.4
2020
* Author: Codeboxr
2121
* Author URI: https://github.com/PHPOffice/PhpDomPDF
2222
* License: MIT
@@ -31,7 +31,7 @@
3131
}
3232

3333
defined('CBXPHPFPDF_PLUGIN_NAME') or define('CBXPHPFPDF_PLUGIN_NAME', 'cbxphpfpdf');
34-
defined('CBXPHPFPDF_PLUGIN_VERSION') or define('CBXPHPFPDF_PLUGIN_VERSION', '1.0.3');
34+
defined('CBXPHPFPDF_PLUGIN_VERSION') or define('CBXPHPFPDF_PLUGIN_VERSION', '1.0.4');
3535
defined('CBXPHPFPDF_BASE_NAME') or define('CBXPHPFPDF_BASE_NAME', plugin_basename(__FILE__));
3636
defined('CBXPHPFPDF_ROOT_PATH') or define('CBXPHPFPDF_ROOT_PATH', plugin_dir_path(__FILE__));
3737
defined('CBXPHPFPDF_ROOT_URL') or define('CBXPHPFPDF_ROOT_URL', plugin_dir_url(__FILE__));
@@ -45,7 +45,7 @@ class CBXPhpFpdf
4545
{
4646
function __construct()
4747
{
48-
add_filter('plugin_row_meta', array($this, 'plugin_row_meta'), 10, 2);
48+
add_filter('plugin_row_meta', array($this, 'plugin_row_meta'), 10, 4);
4949
add_action( 'admin_notices', [ $this, 'activation_error_display' ] );
5050

5151
add_action( 'init', [ $this, 'load_plugin_textdomain' ]);
@@ -74,9 +74,6 @@ public static function activation()
7474

7575
if ( sizeof( $errors ) > 0 ) {
7676
update_option( 'cbxphpfpdf_activation_error', $errors );
77-
//deactivate_plugins(plugin_basename(__FILE__));
78-
//wp_die('Plugin not activated due to dependency not fulfilled.');
79-
//die();
8077
}
8178

8279
}//end method activation
@@ -139,27 +136,31 @@ public static function environment_ready() {
139136
return self::php_version_check() && self::extension_check( [ 'zip', 'xml', 'gd', 'mbstring', 'dom' ]);
140137
}//end method environment_ready
141138

142-
/**
143-
* Plugin support and doc page url
144-
*
145-
* @param $links
146-
* @param $file
147-
*
148-
* @return array
149-
*/
150-
public function plugin_row_meta($links, $file)
151-
{
152-
if (strpos($file, 'cbxphpfpdf.php') !== false) {
153-
$new_links = array(
154-
'support' => '<a href="https://github.com/codeboxrcodehub/cbxphpfpdf" target="_blank">' . esc_html__('Support', 'cbxphpfpdf') . '</a>',
155-
'doc' => '<a href="https://github.com/dompdf/dompdf" target="_blank">' . esc_html__('PHP Dompdf Doc', 'cbxphpfpdf') . '</a>'
156-
);
157-
158-
$links = array_merge($links, $new_links);
159-
}
139+
/**
140+
* Filters the array of row meta for each/specific plugin in the Plugins list table.
141+
* Appends additional links below each/specific plugin on the plugins page.
142+
*
143+
* @access public
144+
*
145+
* @param array $links_array An array of the plugin's metadata
146+
* @param string $plugin_file_name Path to the plugin file
147+
* @param array $plugin_data An array of plugin data
148+
* @param string $status Status of the plugin
149+
*
150+
* @return array $links_array
151+
*/
152+
public function plugin_row_meta( $links_array, $plugin_file_name, $plugin_data, $status ) {
153+
if ( strpos( $plugin_file_name, CBXPHPFPDF_BASE_NAME ) !== false ) {
154+
if ( ! function_exists( 'is_plugin_active' ) ) {
155+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
156+
}
157+
158+
$links_array[] = '<a target="_blank" style="color:#005ae0 !important; font-weight: bold;" href="https://github.com/codeboxrcodehub/cbxphpfpdf" aria-label="' . esc_attr__( 'Github Repo', 'cbxphpfpdf' ) . '">' . esc_html__( 'Github Repo', 'cbxphpfpdf' ) . '</a>';
159+
$links_array[] = '<a target="_blank" style="color:#005ae0 !important; font-weight: bold;" href="https://github.com/codeboxrcodehub/cbxphpfpdf/releases" aria-label="' . esc_attr__( 'Download', 'cbxphpfpdf' ) . '">' . esc_html__( 'Download Latest', 'cbxphpfpdf' ) . '</a>';
160+
}
160161

161-
return $links;
162-
}
162+
return $links_array;
163+
}//end plugin_row_meta
163164

164165
/**
165166
* Load textdomain

languages/cbxphpfpdf.pot

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ msgid ""
33
msgstr ""
44
"Project-Id-Version: CBX PHPFPDF Library\n"
55
"Report-Msgid-Bugs-To: \n"
6-
"POT-Creation-Date: 2025-02-12 10:29+0000\n"
6+
"POT-Creation-Date: 2025-04-15 17:42+0000\n"
77
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
88
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
99
"Language-Team: \n"
@@ -20,34 +20,38 @@ msgstr ""
2020
msgid "CBX PHPFPDF Library"
2121
msgstr ""
2222

23-
#: cbxphpfpdf.php:67
23+
#: cbxphpfpdf.php:72
2424
msgid "CBX PhpFPDF Library plugin requires PHP extensions: Zip, XML, and GD2."
2525
msgstr ""
2626

27-
#: cbxphpfpdf.php:63
27+
#: cbxphpfpdf.php:68
2828
msgid "CBX PhpFPDF Library plugin requires PHP version 7.1 or newer"
2929
msgstr ""
3030

3131
#. Author of the plugin
3232
msgid "Codeboxr"
3333
msgstr ""
3434

35+
#: cbxphpfpdf.php:159
36+
msgid "Download"
37+
msgstr ""
38+
39+
#: cbxphpfpdf.php:159
40+
msgid "Download Latest"
41+
msgstr ""
42+
3543
#. Description of the plugin
3644
msgid "fpdf library as WordPress plugin based on https://github.com/fawno/FPDF"
3745
msgstr ""
3846

47+
#: cbxphpfpdf.php:158
48+
msgid "Github Repo"
49+
msgstr ""
50+
3951
#. URI of the plugin
4052
msgid "https://github.com/codeboxrcodehub/cbxphpfpdf"
4153
msgstr ""
4254

4355
#. Author URI of the plugin
4456
msgid "https://github.com/PHPOffice/PhpDomPDF"
4557
msgstr ""
46-
47-
#: cbxphpfpdf.php:150
48-
msgid "PHP Dompdf Doc"
49-
msgstr ""
50-
51-
#: cbxphpfpdf.php:149
52-
msgid "Support"
53-
msgstr ""

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributors: codeboxr, manchumahara
33
Requires at least: 5.3
44
Tested up to: 6.8
5-
Stable tag: 1.0.3
5+
Stable tag: 1.0.4
66
License: MIT
77
License URI: https://github.com/codeboxrcodehub/cbxphpfpdf/blob/master/LICENSE.txt
88

@@ -30,6 +30,9 @@ based on https://github.com/Setasign/FPDF which is based on original sourcecode
3030

3131

3232
== Changelog ==
33+
= 1.0.4 =
34+
* [updated] Improved the plugin's important link/help url display
35+
3336
= 1.0.3 =
3437
* [updated] Plugin update checker added
3538

0 commit comments

Comments
 (0)