diff --git a/.distignore b/.distignore index 8585d19..3081cf9 100644 --- a/.distignore +++ b/.distignore @@ -15,6 +15,7 @@ _config.yml .distignore +.editorconfig .gitignore CHANGELOG.md composer.json diff --git a/.github/workflows/deploy-assets.yml b/.github/workflows/deploy-assets.yml deleted file mode 100644 index d03ec5c..0000000 --- a/.github/workflows/deploy-assets.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Plugin asset/readme update - -on: - push: - branches: - - master - -jobs: - deploy: - name: Update plugin and assets - runs-on: ubuntu-latest - environment: wp.org plugin - - steps: - - name: Check out Git repository - uses: actions/checkout@master - - - name: WordPress.org plugin asset/readme update - uses: 10up/action-wordpress-plugin-asset-update@master - env: - SVN_USERNAME: ${{ secrets.SVN_USERNAME }} - SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} - IGNORE_OTHER_FILES: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 47c4a28..72f9b6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog All notable changes to this project will be documented in this file. +## 1.8.1 +Release Date: May 22, 2022 + +* Fixed: Notice can't be dismissed and causing a error. + ## 1.8.0 Release Date: May 21, 2022 diff --git a/composer.json b/composer.json index a08c372..c276524 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "iamsayan/wp-last-modified-info", - "description": "Adds last modified date and time automatically on pages and posts very easily. It is possible to use shortcodes to display last modified info anywhere on a WordPress site running 4.7 and beyond.", + "description": "Ultimate Last Modified Plugin for WordPress with Gutenberg Block Integration. It is possible to use shortcodes to display last modified info anywhere on a WordPress site running 4.7 and beyond.", "type": "wordpress-plugin", "license": "GPL-3.0", "authors": [ @@ -31,13 +31,19 @@ }, "scripts": { "build": [ - "composer dump-autoload -o" + "composer dump-autoload" ], "analyze": [ "clear", "vendor/bin/phpstan analyze inc wp-last-modified-info.php" - ] + ], + "pot" : [ + "wp i18n make-pot . languages/wp-last-modified-info.pot --exclude=\"/vendor,/assets,/blocks\"" + ] }, + "config": { + "optimize-autoloader": true + }, "require": { "deliciousbrains/wp-background-processing": "^1.0" } diff --git a/inc/Base/AdminNotice.php b/inc/Base/AdminNotice.php index c151513..d758ed5 100644 --- a/inc/Base/AdminNotice.php +++ b/inc/Base/AdminNotice.php @@ -22,11 +22,6 @@ class AdminNotice extends BaseController { use Hooker; - /** - * Notice. - */ - private $notice; - /** * Register functions. */ @@ -110,6 +105,20 @@ public function notice() { * Dismiss admin notices. */ public function dismiss_notice() { + // Check for Rating Notice + if ( get_option( 'wplmi_plugin_no_thanks_rating_notice' ) === '1' + && get_option( 'wplmi_plugin_dismissed_time' ) <= strtotime( '-14 days' ) ) { + delete_option( 'wplmi_plugin_dismiss_rating_notice' ); + delete_option( 'wplmi_plugin_no_thanks_rating_notice' ); + } + + // Check for Donate Notice + if ( get_option( 'wplmi_plugin_no_thanks_donate_notice' ) === '1' + && get_option( 'wplmi_plugin_dismissed_time_donate' ) <= strtotime( '-15 days' ) ) { + delete_option( 'wplmi_plugin_dismiss_donate_notice' ); + delete_option( 'wplmi_plugin_no_thanks_donate_notice' ); + } + if ( ! isset( $_REQUEST['wplmi_notice_action'] ) || empty( $_REQUEST['wplmi_notice_action'] ) ) { return; } @@ -119,26 +128,9 @@ public function dismiss_notice() { $notice = sanitize_text_field( $_REQUEST['wplmi_notice_action'] ); $notice = explode( '_', $notice ); $notice_type = end( $notice ); - $notice_action = join( '_', array_pop( $notice ) ); + array_pop( $notice ); + $notice_action = join( '_', $notice ); - // Check for Rating Notice - if ( get_option( 'wplmi_plugin_no_thanks_rating_notice' ) === '1' ) { - if ( get_option( 'wplmi_plugin_dismissed_time' ) > strtotime( '-14 days' ) ) { - return; - } - delete_option( 'wplmi_plugin_dismiss_rating_notice' ); - delete_option( 'wplmi_plugin_no_thanks_rating_notice' ); - } - - // Check for Donate Notice - if ( get_option( 'wplmi_plugin_no_thanks_donate_notice' ) === '1' ) { - if ( get_option( 'wplmi_plugin_dismissed_time_donate' ) > strtotime( '-15 days' ) ) { - return; - } - delete_option( 'wplmi_plugin_dismiss_donate_notice' ); - delete_option( 'wplmi_plugin_no_thanks_donate_notice' ); - } - if ( 'dismiss' === $notice_action ) { update_option( 'wplmi_plugin_dismiss_' . $notice_type . '_notice', '1' ); } diff --git a/inc/Base/Deactivate.php b/inc/Base/Deactivate.php index d396fb0..a704663 100644 --- a/inc/Base/Deactivate.php +++ b/inc/Base/Deactivate.php @@ -24,7 +24,9 @@ public static function deactivate() { } delete_option( 'wplmi_plugin_dismiss_rating_notice' ); + delete_option( 'wplmi_plugin_dismiss_donate_notice' ); delete_option( 'wplmi_plugin_no_thanks_rating_notice' ); + delete_option( 'wplmi_plugin_no_thanks_donate_notice' ); delete_option( 'wplmi_plugin_installed_time' ); delete_option( 'wplmi_plugin_installed_time_donate' ); } diff --git a/languages/wp-last-modified-info.pot b/languages/wp-last-modified-info.pot index 51f5dd7..27d350f 100644 --- a/languages/wp-last-modified-info.pot +++ b/languages/wp-last-modified-info.pot @@ -9,7 +9,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2022-05-21T06:08:21+00:00\n" +"POT-Creation-Date: 2022-05-21T15:14:58+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.5.0\n" "X-Domain: wp-last-modified-info\n" @@ -302,41 +302,41 @@ msgstr "" msgid "Use these tags. Available Dynamic Tags" msgstr "" -#: inc/Base/AdminNotice.php:52 +#: inc/Base/AdminNotice.php:47 msgid "Your version of PHP is below the minimum version of PHP required by WP Last Modified Info plugin. Please contact your host and request that your version be upgraded to 5.6 or later." msgstr "" #. translators: %s: 1. Plugin Name, 2. Version, 3. Link -#: inc/Base/AdminNotice.php:61 +#: inc/Base/AdminNotice.php:56 msgid "Thanks for installing %1$s v%2$s plugin. Click here to configure plugin settings." msgstr "" -#: inc/Base/AdminNotice.php:79 +#: inc/Base/AdminNotice.php:74 msgid "Ok, you deserve it" msgstr "" -#: inc/Base/AdminNotice.php:80 +#: inc/Base/AdminNotice.php:75 msgid "I already did" msgstr "" -#: inc/Base/AdminNotice.php:81 -#: inc/Base/AdminNotice.php:102 +#: inc/Base/AdminNotice.php:76 +#: inc/Base/AdminNotice.php:97 msgid "Nope, maybe later" msgstr "" -#: inc/Base/AdminNotice.php:82 +#: inc/Base/AdminNotice.php:77 msgid "I don't want to rate" msgstr "" -#: inc/Base/AdminNotice.php:100 +#: inc/Base/AdminNotice.php:95 msgid "Donate Now" msgstr "" -#: inc/Base/AdminNotice.php:101 +#: inc/Base/AdminNotice.php:96 msgid "I already donated" msgstr "" -#: inc/Base/AdminNotice.php:103 +#: inc/Base/AdminNotice.php:98 msgid "I don't want to donate" msgstr "" diff --git a/readme.txt b/readme.txt index e581997..dede5bc 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: infosatech Tags: last modified, timestamp, modified time, post modified, sort by modified, time, date Requires at least: 4.7 Tested up to: 6.0 -Stable tag: 1.8.0 +Stable tag: 1.8.1 Requires PHP: 5.6 Donate link: https://www.paypal.me/iamsayan/ License: GPLv3 @@ -164,6 +164,11 @@ Post detailed information about the issue in the [support forum](https://wordpre If you like WP Last Modified Info, please take a moment to [give a 5-star rating](https://wordpress.org/support/plugin/wp-last-modified-info/reviews/?rate=5#new-post). It helps to keep development and support going strong. Thank you! += 1.8.1 = +Release Date: May 22, 2022 + +* Fixed: Notice can't be dismissed and causing a error. + = 1.8.0 = Release Date: May 21, 2022 @@ -188,9 +193,4 @@ Release Date: May 21, 2022 = Other Versions = -* View the Changelog file. - -== Upgrade Notice == - -= 1.8.0 = -In this release, we make this plugin compatible with WordPress 6.0. You may need to re-configure your plugin settings once, to get it properly working. \ No newline at end of file +* View the Changelog file. \ No newline at end of file diff --git a/templates/admin.php b/templates/admin.php index 54f81fd..5f3a0e7 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -207,7 +207,7 @@
WP Last Modified Info v' . $this->version . '' ); ?>
-Developed with ♥ by Sayan Datta | Hire Me | GitHub | Support | Translate | Rate it (★★★★★) on WordPress.org, if you like this plugin.
+Developed with ♥ by Sayan Datta | Hire Me | GitHub | Support | Translate | Rate it (★★★★★) on WordPress.org, if you like this plugin.
diff --git a/wp-last-modified-info.php b/wp-last-modified-info.php index 810112e..79b3826 100644 --- a/wp-last-modified-info.php +++ b/wp-last-modified-info.php @@ -3,7 +3,7 @@ * Plugin Name: WP Last Modified Info * Plugin URI: https://wordpress.org/plugins/wp-last-modified-info/ * Description: Ultimate Last Modified Plugin for WordPress with Gutenberg Block Integration. It is possible to use shortcodes to display last modified info anywhere on a WordPress site running 4.7 and beyond. - * Version: 1.8.0 + * Version: 1.8.1 * Author: Sayan Datta * Author URI: https://sayandatta.in * License: GPLv3 @@ -37,7 +37,7 @@ } // Define constants -define( 'WPLMI_VERSION', '1.8.0' ); +define( 'WPLMI_VERSION', '1.8.1' ); // Require once the Composer Autoload if ( file_exists( dirname( __FILE__ ) . '/vendor/autoload.php' ) ) {