From 8e779ce5e28c0bbae9e2401d14f4b2ce53fa33a9 Mon Sep 17 00:00:00 2001 From: Raunak Gupta Date: Sat, 9 Sep 2023 17:47:24 +0530 Subject: [PATCH] Fix - Notice: Trying to access array offset on value of type bool --- CHANGELOG.md | 5 +++ Includes/Updater.php | 97 ------------------------------------------- package.json | 2 +- readme.txt | 8 +++- vaaky-highlighter.php | 14 +------ 5 files changed, 14 insertions(+), 112 deletions(-) delete mode 100644 Includes/Updater.php diff --git a/CHANGELOG.md b/CHANGELOG.md index f880d3f..d8b1aa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Vaaky Highlighter - Changelog +### 1.0.5 → 2023-09-09 + +- Fix - Notice: Trying to access array offset on value of type bool +- Tested and updated WordPress compatibility with new version + ### 1.0.4 → 2023-05-05 - Tested and updated WordPress compatibility with new version diff --git a/Includes/Updater.php b/Includes/Updater.php deleted file mode 100644 index 1f7a2b6..0000000 --- a/Includes/Updater.php +++ /dev/null @@ -1,97 +0,0 @@ - - */ -class Updater -{ - /** - * Update the plugin, by running the incremental updates one by one. - * - * For example, if the current DB version is 0, and the target DB version is 2, - * this function will execute update routines: - * - updateRoutine1() - * - updateRoutine2() - * - * @param int $currentDatabaseVersion The current database version expected by the plugin. - * @param string $configurationOptionName The ID for the configuration options in the database. - * @since 1.0.0 - */ - public static function update($currentDatabaseVersion, $configurationOptionName) - { - $multisite = is_multisite(); - - // Get the configuration data - $currentNetworkId = get_current_network_id(); - $configuration = get_network_option($currentNetworkId, $configurationOptionName); - - $installedDatabaseVersion = $configuration['db-version']; - if ($installedDatabaseVersion < $currentDatabaseVersion) - { - // Run update routines one by one until the current version number reaches the target version number - while ($installedDatabaseVersion < $currentDatabaseVersion) - { - $installedDatabaseVersion++; - - // Each db version will require a separate update function for example, - // for db-version 1, the function name should be updateRoutine1 - $updateRoutineFunctionName = 'updateRoutine' . $installedDatabaseVersion; - - if (is_callable(array(self, $updateRoutineFunctionName))) - { - if ($multisite) - { - // Loop through the sites - foreach (get_sites(['fields' => 'ids']) as $blogId) - { - switch_to_blog($blogId); - call_user_func(array(self, $updateRoutineFunctionName)); - restore_current_blog(); - } - } - else - { - call_user_func(array(self, $updateRoutineFunctionName)); - } - - // Update the configuration option in the database, so that this process can always pick up where it left off - $configuration['db-version'] = $installedDatabaseVersion; - update_network_option($currentNetworkId, $configurationOptionName, $configuration); - } - else - { - wp_die(__('Update routine not callable: ', 'vaaky-highlighter') . __CLASS__ . '\\' . $updateRoutineFunctionName . '()'); - } - } - } - } - - /** - * Update routine for the upcoming database version called by 'update' function - * - * @since 1.0.0 - */ - private static function updateRoutine1() - { - /** - * Usefull tools to consider: - * - array_merge() - * - dbDelta() - * - wpdb Class - */ - } - -} \ No newline at end of file diff --git a/package.json b/package.json index 1322912..a66fd3b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vaaky-blocks", - "version": "1.0.4", + "version": "1.0.5", "license": "MIT", "main": "Admin/js/block.js", "scripts": { diff --git a/readme.txt b/readme.txt index c379d1d..c39bb35 100644 --- a/readme.txt +++ b/readme.txt @@ -3,9 +3,9 @@ Contributors: raunak01 Donate link: https://www.webhat.in/ Tags: syntax highlighter, gutenberg, blocks, snippets, highlight.js, highlighter, php, js, sourcecode, code Requires at least: 5.0 -Tested up to: 6.2 +Tested up to: 6.3.1 Requires PHP: 5.6 -Stable tag: 1.0.4 +Stable tag: 1.0.5 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -125,6 +125,10 @@ If you know the abbreviation of the language then you can provide in `lang` attr == Changelog == += 1.0.5 2023-09-09 = +* Fix - Notice: Trying to access array offset on value of type bool +* Tested and updated WordPress compatibility with new version + = 1.0.4 2023-05-05 = * Tested and updated WordPress compatibility with new version diff --git a/vaaky-highlighter.php b/vaaky-highlighter.php index 8452bc8..68a0609 100644 --- a/vaaky-highlighter.php +++ b/vaaky-highlighter.php @@ -10,7 +10,7 @@ * Plugin Name: Vaaky Highlighter * Plugin URI: https://wordpress.org/plugin/vaaky-highlighter * Description: Simple yet elegant syntax or code highlighter based on highlight.js. It allows you to add engaging snippet code blocks. - * Version: 1.0.4 + * Version: 1.0.5 * Author: Raunak Gupta * Author URI: https://www.webhat.in/ * License: GPL-2.0+ @@ -24,7 +24,6 @@ use VaakyHighlighter\Includes\Activator; use VaakyHighlighter\Includes\Deactivator; -use VaakyHighlighter\Includes\Updater; use VaakyHighlighter\Includes\Main; // If this file is called directly, abort. @@ -39,7 +38,7 @@ /** * Current plugin version. */ -define('VAAKY_HIGHLIGHTER_VERSION', '1.0.4'); +define('VAAKY_HIGHLIGHTER_VERSION', '1.0.5'); /** * The string used to uniquely identify this plugin. @@ -103,15 +102,6 @@ Deactivator::deactivate($networkWide); }); -/** - * Update the plugin. - * It runs every time, when the plugin is started. - */ -add_action('plugins_loaded', function() use ($configuration, $configurationOptionName) -{ - Updater::update($configuration['db-version'], $configurationOptionName); -}, 1); - /** * Begins execution of the plugin. *