From 4c9ba8507c873a1f7d0c6cdacb9b095189392ec7 Mon Sep 17 00:00:00 2001 From: Norcross Date: Tue, 15 Dec 2020 16:17:01 -0500 Subject: [PATCH 1/5] adding check to hide icon when debug file is empty --- includes/admin/admin-bar.php | 50 ++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/includes/admin/admin-bar.php b/includes/admin/admin-bar.php index 8e3ee70..c0b0d6d 100644 --- a/includes/admin/admin-bar.php +++ b/includes/admin/admin-bar.php @@ -26,6 +26,14 @@ */ function add_admin_bar_item( \WP_Admin_Bar $wp_admin_bar ) { + // Add the check to hide the empty. + $check_show = maybe_hide_admin_icon(); + + // Bail if we got a false. + if ( false === $check_show ) { + return; + } + // Get my purge file args. $purge_args = fetch_admin_bar_args(); @@ -35,6 +43,28 @@ function add_admin_bar_item( \WP_Admin_Bar $wp_admin_bar ) { } } +/** + * Check to see if we should show the empty. + * + * @return boolean + */ +function maybe_hide_admin_icon() { + + // First pass in our filter. + $hide_empty = apply_filters( Core\HOOK_PREFIX . 'hide_icon_when_empty', true ); + + // If we don't care, show it regardless. + if ( false === $hide_empty ) { + return true; + } + + // Now get the file size. + $debug_size = Helpers\get_logfile_size(); + + // Now return the result. + return ! empty( $debug_size ) ? true : false; +} + /** * Set all the args for the purge debug admin bar item. * @@ -43,31 +73,31 @@ function add_admin_bar_item( \WP_Admin_Bar $wp_admin_bar ) { function fetch_admin_bar_args() { // Get the actual purge link. - $adminbar_link = Helpers\get_logfile_purge_link(); + $get_admin_bar_link = Helpers\get_logfile_purge_link(); // Bail if we don't have a link. - if ( empty( $adminbar_link ) ) { + if ( empty( $get_admin_bar_link ) ) { return; } // Get the standard title, which is a trash can for us. - $fetch_titles = Helpers\get_admin_bar_titles(); + $admin_bar_titles = Helpers\get_admin_bar_titles(); // Decide if a target blank. - $adminbar_blank = ! is_admin() ? '_blank' : ''; + $maybe_link_target = ! is_admin() ? '_blank' : ''; // Now set up the args. - $adminbar_array = array( + $set_admin_bar_args = array( 'id' => Core\ADMIN_BAR_ID, - 'title' => $fetch_titles['title'], - 'href' => esc_url( $adminbar_link ), + 'title' => $admin_bar_titles['title'], + 'href' => esc_url( $get_admin_bar_link ), 'position' => 0, 'meta' => array( - 'title' => esc_attr( $fetch_titles['hover'] ), - 'target' => $adminbar_blank, + 'title' => esc_attr( $admin_bar_titles['hover'] ), + 'target' => $maybe_link_target, ), ); // And return them, filtered. - return apply_filters( Core\HOOK_PREFIX . 'admin_bar_args', $adminbar_array ); + return apply_filters( Core\HOOK_PREFIX . 'admin_bar_args', $set_admin_bar_args ); } From e6dc8771da4092b0da42d849224b0a0234cc7d42 Mon Sep 17 00:00:00 2001 From: Norcross Date: Fri, 13 May 2022 11:01:19 -0400 Subject: [PATCH 2/5] moving user role check to after flag check --- includes/admin/request.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/admin/request.php b/includes/admin/request.php index e86608e..e2c7bd3 100644 --- a/includes/admin/request.php +++ b/includes/admin/request.php @@ -33,16 +33,16 @@ function purge_debug_via_user( $args ) { return; } - // Bail on a non authorized user. - if ( ! current_user_can( 'manage_options' ) ) { - wp_die( __( 'You are not authorized to perform this function.', 'quick-purge-debug' ), __( 'Quick Purge Debug Tool', 'quick-purge-debug' ) ); - } - // Check for the query string. if ( empty( $_GET['qpd-purge-run'] ) ) { return; } + // Bail on a non authorized user. + if ( ! current_user_can( 'manage_options' ) ) { + wp_die( __( 'You are not authorized to perform this function.', 'quick-purge-debug' ), __( 'Quick Purge Debug Tool', 'quick-purge-debug' ) ); + } + // Now check the nonce. if ( ! $_GET['qpd-purge-nonce'] || ! wp_verify_nonce( $_GET['qpd-purge-nonce'], Core\NONCE_PREFIX . '-run' ) ) { wp_die( __( 'Your security nonce failed.', 'quick-purge-debug' ), __( 'Quick Purge Debug Tool', 'quick-purge-debug' ) ); From 859f6782bd27d8f12e20d60a276372b7877f07d0 Mon Sep 17 00:00:00 2001 From: Norcross Date: Mon, 2 Dec 2024 10:49:15 -0500 Subject: [PATCH 3/5] cleanup and updating sorta forgot i made this --- includes/activate.php | 5 +---- includes/admin/admin-bar.php | 8 ++++---- includes/admin/notices.php | 30 +++++++++++++++++++----------- includes/admin/request.php | 31 +++++++++++++++++++------------ includes/admin/setup.php | 9 +++------ includes/cli-commands.php | 27 ++++++--------------------- includes/deactivate.php | 5 +---- includes/helpers.php | 33 +++++++++++++++++++-------------- includes/uninstall.php | 3 --- 9 files changed, 72 insertions(+), 79 deletions(-) diff --git a/includes/activate.php b/includes/activate.php index c034f05..2f20a03 100644 --- a/includes/activate.php +++ b/includes/activate.php @@ -1,6 +1,6 @@ Core\ADMIN_BAR_ID, 'title' => $admin_bar_titles['title'], 'href' => esc_url( $get_admin_bar_link ), 'position' => 0, - 'meta' => array( + 'meta' => [ 'title' => esc_attr( $admin_bar_titles['hover'] ), 'target' => $maybe_link_target, - ), - ); + ], + ]; // And return them, filtered. return apply_filters( Core\HOOK_PREFIX . 'admin_bar_args', $set_admin_bar_args ); diff --git a/includes/admin/notices.php b/includes/admin/notices.php index e230379..f0c200f 100644 --- a/includes/admin/notices.php +++ b/includes/admin/notices.php @@ -24,35 +24,43 @@ */ function admin_result_notices() { - // Make sure we have the completed flags. - if ( empty( $_GET['qpd-purge-complete'] ) || empty( $_GET['qpd-purge-result'] ) ) { + // Confirm this is one of our notices when done. + $confirm_isdone = filter_input( INPUT_GET, 'qpd-purge-complete', FILTER_SANITIZE_SPECIAL_CHARS ); + + // Make sure it is what we want. + if ( empty( $confirm_isdone ) || 'yes' !== $confirm_isdone ) { return; } - // Determine the message type. - $result = ! empty( $_GET['qpd-purge-result'] ) && 'success' === sanitize_text_field( $_GET['qpd-purge-result'] ) ? 'success' : 'error'; + // Confirm this is one of our results when done. + $confirm_result = filter_input( INPUT_GET, 'qpd-purge-result', FILTER_SANITIZE_SPECIAL_CHARS ); + + // Make sure it is acceptable. + if ( empty( $confirm_result ) || ! in_array( $confirm_result, ['success', 'error'], true ) ) { + return; + } - // Handle the success first - if ( 'error' !== $result ) { + // Handle the success first. + if ( 'success' === $confirm_result ) { // Go get my text to display. - $notice = Helpers\get_admin_notice_text( 'purge-success' ); + $isdone_message = Helpers\get_admin_notice_text( 'purge-success' ); // And handle the display. - display_admin_notice_markup( $notice, $result ); + display_admin_notice_markup( $isdone_message, $confirm_result ); // And be done. return; } // Figure out my error code. - $error_code = ! empty( $_GET['qpd-purge-error'] ) ? $_GET['qpd-purge-error'] : 'unknown'; + $confirm_error = filter_input( INPUT_GET, 'qpd-purge-error', FILTER_SANITIZE_SPECIAL_CHARS ); // Handle my error text retrieval. - $error_text = Helpers\get_admin_notice_text( $error_code ); + $error_message = Helpers\get_admin_notice_text( $confirm_error ); // And handle the display. - display_admin_notice_markup( $error_text, 'error' ); + display_admin_notice_markup( $error_message, 'error' ); } /** diff --git a/includes/admin/request.php b/includes/admin/request.php index e2c7bd3..ee20d80 100644 --- a/includes/admin/request.php +++ b/includes/admin/request.php @@ -27,25 +27,32 @@ */ function purge_debug_via_user( $args ) { - // Bail if the user is not logged in, an Ajax call, or a CLI call. - if ( ! is_user_logged_in() || ! is_admin() || wp_doing_ajax() || defined( 'WP_CLI' ) && WP_CLI ) { + if ( ! is_user_logged_in() || ! is_admin() || wp_doing_ajax() || defined( 'WP_CLI' ) && WP_CLI ) { // phpcs:ignore -- the nonce check is happening soon. return; } - // Check for the query string. - if ( empty( $_GET['qpd-purge-run'] ) ) { + // Confirm we requested this action. + $confirm_action = filter_input( INPUT_GET, 'qpd-purge-run', FILTER_SANITIZE_SPECIAL_CHARS ); // phpcs:ignore -- the nonce check is happening soon. + + // Make sure it is what we want. + if ( empty( $confirm_action ) || 'yes' !== $confirm_action ) { return; } // Bail on a non authorized user. - if ( ! current_user_can( 'manage_options' ) ) { + if ( ! current_user_can( 'manage_options' ) ) { // phpcs:ignore -- the nonce check is happening soon. wp_die( __( 'You are not authorized to perform this function.', 'quick-purge-debug' ), __( 'Quick Purge Debug Tool', 'quick-purge-debug' ) ); } - // Now check the nonce. - if ( ! $_GET['qpd-purge-nonce'] || ! wp_verify_nonce( $_GET['qpd-purge-nonce'], Core\NONCE_PREFIX . '-run' ) ) { - wp_die( __( 'Your security nonce failed.', 'quick-purge-debug' ), __( 'Quick Purge Debug Tool', 'quick-purge-debug' ) ); + // Make sure we have a nonce. + $confirm_nonce = filter_input( INPUT_GET, 'qpd-purge-nonce', FILTER_SANITIZE_SPECIAL_CHARS ); // phpcs:ignore -- the nonce check is happening after this. + + // Handle the nonce check. + if ( empty( $confirm_nonce ) || ! wp_verify_nonce( $confirm_nonce, Core\NONCE_PREFIX . '_run' ) ) { + + // Let them know they had a failure. + wp_die( esc_html__( 'There was an error validating the nonce.', 'quick-purge-debug' ), esc_html__( 'Quick Purge Debug Tool', 'quick-purge-debug' ), [ 'back_link' => true ] ); } // Get our logfile. @@ -87,16 +94,16 @@ function run_redirect_after_purge( $purge_result = '', $error_code = '' ) { $set_purge_result = ! empty( $purge_result ) && 'success' === sanitize_text_field( $purge_result ) ? 'success' : 'error'; // Set up the args for the redirect. - $set_redirect_args = array( - 'qpd-purge-complete' => 1, + $set_redirect_args = [ + 'qpd-purge-complete' => 'yes', 'qpd-purge-result' => $set_purge_result, 'qpd-purge-error' => $error_code, - ); + ]; // And redirect with a query string. $set_redirect_url = add_query_arg( $set_redirect_args, admin_url( '/' ) ); // Then redirect. - wp_redirect( $set_redirect_url ); + wp_safe_redirect( $set_redirect_url ); exit; } diff --git a/includes/admin/setup.php b/includes/admin/setup.php index 2761394..059ad03 100644 --- a/includes/admin/setup.php +++ b/includes/admin/setup.php @@ -27,17 +27,14 @@ function admin_removable_args( $args ) { // Set an array of the args we wanna exclude. - $remove = array( + $remove = [ 'qpd-purge-run', 'qpd-purge-nonce', 'qpd-purge-complete', 'qpd-purge-result', 'qpd-purge-error', - ); - - // Set the array of new args. - $setup = apply_filters( Core\HOOK_PREFIX . 'admin_removable_args', $remove ); + ]; // Include my new args and return. - return ! empty( $setup ) ? wp_parse_args( $setup, $args ) : $args; + return wp_parse_args( $remove, $args ); } diff --git a/includes/cli-commands.php b/includes/cli-commands.php index 0b07b17..76e7769 100644 --- a/includes/cli-commands.php +++ b/includes/cli-commands.php @@ -48,29 +48,14 @@ function run() { // Erase the debug file. $maybe_purge_file = file_put_contents( $fetch_logfile_src, '' ); - // And run our redirect if it worked. - if ( false !== $maybe_purge_file ) { - - // Show the result and bail. - WP_CLI::success( Helpers\get_admin_notice_text( 'purge-success' ) ); - WP_CLI::halt( 0 ); + // Throw the error message if that failed. + if ( false === $maybe_purge_file ) { + WP_CLI::error( Helpers\get_admin_notice_text( 'purge-file-error' ) ); } - // Redirect the error. - WP_CLI::error( Helpers\get_admin_notice_text( 'purge-file-error' ) ); - } - - /** - * This is a placeholder function for testing. - * - * ## EXAMPLES - * - * wp quick-debug-purge runtests - * - * @when after_wp_load - */ - function runtests() { - // This is blank, just here when I need it. + // Tell me I did a good job. + WP_CLI::success( Helpers\get_admin_notice_text( 'purge-success' ) ); + WP_CLI::halt( 0 ); } // End all custom CLI commands. diff --git a/includes/deactivate.php b/includes/deactivate.php index e65ee98..30b78a2 100644 --- a/includes/deactivate.php +++ b/includes/deactivate.php @@ -1,6 +1,6 @@ 1, - 'qpd-purge-nonce' => wp_create_nonce( Core\NONCE_PREFIX . '-run' ), - ); + $set_purge_args = [ + 'qpd-purge-run' => 'yes', + 'qpd-purge-nonce' => wp_create_nonce( Core\NONCE_PREFIX . '_run' ), + ]; - // Now create the link. - $construct_link = add_query_arg( $set_purge_args, admin_url( '/' ) ); - - // And return the link. - return apply_filters( Core\HOOK_PREFIX . 'logfile_purge_link', $construct_link ); + // Now create the link and return it. + return add_query_arg( $set_purge_args, admin_url( '/' ) ); } /** @@ -85,10 +82,10 @@ function get_admin_bar_titles() { $adminbar_hover = ! empty( $debug_filesize ) ? sprintf( __( 'Purge Debug File (%d bytes)', 'quick-purge-debug' ), absint( $debug_filesize ) ) : __( 'Purge Debug File (empty)', 'quick-purge-debug' ); // Now set the array. - $set_admin_ttls = array( + $set_admin_ttls = [ 'title' => '', 'hover' => $adminbar_hover, - ); + ]; // Return the titles, filtered. return apply_filters( Core\HOOK_PREFIX . 'admin_bar_titles', $set_admin_ttls ); @@ -103,7 +100,15 @@ function get_admin_bar_titles() { */ function get_admin_notice_text( $return_code = '' ) { - // Handle my different error codes. + // Allow a possible custom message first. + $maybe_custom = apply_filters( Core\HOOK_PREFIX . 'custom_message_text', '', $return_code ); + + // If someone passed a custom, do that. + if ( ! empty( $maybe_custom ) ) { + return $maybe_custom; + } + + // Handle my different message codes. switch ( esc_attr( $return_code ) ) { case 'purge-success' : diff --git a/includes/uninstall.php b/includes/uninstall.php index bb80a8d..8fd2415 100644 --- a/includes/uninstall.php +++ b/includes/uninstall.php @@ -20,8 +20,5 @@ function uninstall() { // Include our action so that we may add to this later. do_action( Core\HOOK_PREFIX . 'uninstall_process' ); - - // And flush our rewrite rules. - flush_rewrite_rules(); } register_uninstall_hook( Core\FILE, __NAMESPACE__ . '\uninstall' ); From b9b9f5c60539dfe1c9781980f9154975793b04bf Mon Sep 17 00:00:00 2001 From: Norcross Date: Mon, 2 Dec 2024 10:54:04 -0500 Subject: [PATCH 4/5] removing unused files probably a copy from another project, but not sure it needs to be here --- CHANGELOG.md | 2 +- Gruntfile.js | 207 --------------------------------------- README.md | 2 +- package.json | 34 ------- wp-quick-purge-debug.php | 6 +- 5 files changed, 5 insertions(+), 246 deletions(-) delete mode 100755 Gruntfile.js delete mode 100755 package.json diff --git a/CHANGELOG.md b/CHANGELOG.md index f202f94..31bc76c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,6 @@ All notable changes to this project will be documented in this file, according t This project adheres to [Semantic Versioning](http://semver.org/). -##[0.0.0] +##[0.0.2] * Initial public release. diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100755 index 99603b0..0000000 --- a/Gruntfile.js +++ /dev/null @@ -1,207 +0,0 @@ -module.exports = function( grunt ) { - - 'use strict'; - - // Project configuration - grunt.initConfig( { - - pkg: grunt.file.readJSON( 'package.json' ), - - // Make our distribution copy. - copy: { - main: { - src: [ - 'assets/**', - 'includes/**', - 'languages/**', - 'index.php', - 'wp-quick-purge-debug.php', - 'readme.txt', - 'CHANGELOG.md', - 'LICENSE', - - /* - * Exclude files not necessary in the distribution. - */ - '!assets/scss/**', - '!assets/scss', - '!assets/css/**.map', - ], - dest: 'dist/' - }, - screenshots: { - expand: true, - flatten: true, - cwd: 'repo-assets/screenshots/', - src: ['**'], - dest: 'dist/' - }, - }, - - // Package up the plugin - compress: { - main: { - options: { - archive: 'release/<%= pkg.name %>-<%= pkg.version %>.zip' - }, - files: [ - { - expand: true, - cwd: 'dist/', - src: ['**'], - dest: '<%= pkg.name %>/' - } - ] - } - }, - - // Process the textdomain. - addtextdomain: { - options: { - textdomain: 'quick-purge-debug', - }, - update_all_domains: { - options: { - updateDomains: true - }, - src: [ '*.php', '**/*.php', '!\.git/**/*', '!bin/**/*', '!node_modules/**/*', '!tests/**/*' ] - } - }, - - wp_readme_to_markdown: { - your_target: { - files: { - 'README.md': 'readme.txt' - } - }, - }, - - // Make our POT file. - makepot: { - target: { - options: { - domainPath: '/languages', - exclude: [ '\.git/*', 'bin/*', 'node_modules/*', 'tests/*' ], - mainFile: 'wp-quick-purge-debug.php', - potFilename: 'quick-purge-debug.pot', - potHeaders: { - poedit: true, - 'x-poedit-keywordslist': true - }, - type: 'wp-plugin', - updateTimestamp: true - } - } - }, - - // Set the required items. - required: { - libs: { - options: { - // npm install missing modules - install: true - }, - // Search for require() in all js files in the assets folder - src: ['assets/*.js'] - } - }, - - // Uglify JS - uglify: { - options: { - mangle: true, - compress: { - drop_console: true - } - }, - all: { - files: [{ - expand: true, - cwd: 'assets/js/', - src: ['*.js', '!*.min.js', '!assets/js/ext/*.js'], - dest: 'assets/js/', - ext: '.min.js' - }] - } - }, - - // Compile Sass - sass: { - dist: { - options: { - style: 'compressed' - }, - expand: true, - cwd: 'assets/scss', - src: ['*.scss'], - dest: 'assets/css/', - ext: '.css' - }, - dev: { - options: { - style: 'expanded' - }, - expand: true, - cwd: 'assets/scss', - src: ['*.scss'], - dest: 'assets/css/', - ext: '.css' - }, - }, - // Minify CSS - cssmin: { - minify: { - expand: true, - cwd: 'assets/css', - src: ['*.css', '!*.min.css'], - dest: 'assets/css/', - ext: '.min.css' - } - }, - - // Watch for changes during development - watch: { - options: { - livereload: true - }, - styles: { - files: ['assets/scss/*.scss','assets/scss/**/*.scss'], - tasks: ['sass:dist','cssmin'] - }, - scripts: { - files: ['assets/js/*.js', '!assets/js/*.min.js', '!assets/js/ext/*.js'], - tasks: ['uglify'] - }, - } - - } ); - - grunt.loadNpmTasks( 'grunt-wp-i18n' ); - grunt.loadNpmTasks( 'grunt-wp-readme-to-markdown' ); - grunt.loadNpmTasks( 'grunt-required' ); - grunt.loadNpmTasks( 'grunt-check-modules' ); - grunt.loadNpmTasks( 'grunt-contrib-copy' ); - grunt.loadNpmTasks( 'grunt-contrib-compress' ); - grunt.loadNpmTasks( 'grunt-contrib-clean' ); - grunt.loadNpmTasks( 'grunt-contrib-uglify' ); - grunt.loadNpmTasks( 'grunt-contrib-sass' ); - grunt.loadNpmTasks( 'grunt-contrib-cssmin' ); - grunt.loadNpmTasks( 'grunt-contrib-watch' ); - grunt.loadNpmTasks( 'grunt-replace' ); - - grunt.registerTask( 'default', ['i18n', 'readme', 'check-modules'] ); - grunt.registerTask( 'i18n', ['addtextdomain', 'makepot'] ); - grunt.registerTask( 'readme', ['wp_readme_to_markdown'] ); - - // Package an initial release - grunt.registerTask( 'initial-release', ['wp_readme_to_markdown', 'sass:dist', 'cssmin', 'uglify:all', 'copy:main', 'copy:screenshots', 'compress'] ); - - // Package a general release - grunt.registerTask( 'general-release', ['wp_readme_to_markdown', 'sass:dist', 'cssmin', 'uglify:all', 'copy:main', 'compress'] ); - - // Compile SASS and minify assets - grunt.registerTask( 'pre-commit', ['sass:dist', 'cssmin', 'uglify:all'] ); - - grunt.util.linefeed = '\n'; - -}; diff --git a/README.md b/README.md index 81a0682..c4ec5a6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # Quick Purge Debug for WordPress -Add ways to quickly purge the debug log file. +Adds an admin bar icon and CLI command for quickly purging the debug logfile. diff --git a/package.json b/package.json deleted file mode 100755 index 8adcbcf..0000000 --- a/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "quick-purge-debug", - "version": "0.0.1-dev", - "description": "Add ways to quickly purge the debug log file.", - "repository": { - "type": "git", - "url": "https://github.com/norcross/wp-quick-purge-debug.git" - }, - "author": { - "name": "Andrew Norcross", - "url": "http://andrewnorcross.com" - }, - "license": "MIT", - "dependencies": { - "grunt-cli": "^1.2.0", - "grunt-wp-i18n": "^1.0.2", - "grunt-wp-readme-to-markdown": "^2.0.1", - "npm": "^6.0.1" - }, - "devDependencies": { - "grunt": "^1.2.0", - "grunt-check-modules": "^1.1.0", - "grunt-contrib-clean": "^1.1.0", - "grunt-contrib-compress": "^1.4.3", - "grunt-contrib-copy": "^1.0.0", - "grunt-contrib-cssmin": "^2.2.1", - "grunt-contrib-imagemin": "^2.0.1", - "grunt-contrib-sass": "^1.0.0", - "grunt-contrib-uglify": "^3.1.0", - "grunt-contrib-watch": "^1.0.0", - "grunt-replace": "^1.0.1", - "grunt-required": "^0.1.2" - } -} diff --git a/wp-quick-purge-debug.php b/wp-quick-purge-debug.php index 243785f..ac13299 100644 --- a/wp-quick-purge-debug.php +++ b/wp-quick-purge-debug.php @@ -4,10 +4,10 @@ * Plugin URI: https://github.com/norcross/wp-quick-purge-debug * Description: Add ways to quickly purge the debug log file. * Author: Andrew Norcross - * Author URI: http://andrewnorcross.com + * Author URI: https://andrewnorcross.com * Text Domain: quick-purge-debug * Domain Path: /languages - * Version: 0.0.1 + * Version: 0.0.2 * * @package QuickPurgeDebug */ @@ -22,7 +22,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Define our plugin version. -define( __NAMESPACE__ . '\VERS', '0.0.1-dev' ); +define( __NAMESPACE__ . '\VERS', '0.0.2' ); // Plugin root file. define( __NAMESPACE__ . '\FILE', __FILE__ ); From c860d0f68a83220f16ad123c581758e4f3badd2e Mon Sep 17 00:00:00 2001 From: Norcross Date: Mon, 2 Dec 2024 10:55:37 -0500 Subject: [PATCH 5/5] adding a composer file even though i don't know how it works --- composer.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 composer.json diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..335b0a8 --- /dev/null +++ b/composer.json @@ -0,0 +1,16 @@ +{ + "name": "norcross/quick-purge-debug", + "description": "Adds an admin bar icon and CLI command for quickly purging the debug logfile.", + "type": "wordpress-plugin", + "license": "MIT", + "authors":[ + { + "name": "Andrew Norcross", + "email": "andrew@andrewnorcross.com", + "homepage": "https://github.com/norcross" + } + ], + "require": { + "composer/installers": "^1 || ^2" + } +}