84% wordpress-database-reset

Code Review | Database Reset

WordPress plugin Database Reset scored84%from 54 tests.

About plugin

  • Plugin page: wordpress-databas...
  • Plugin version: 3.22
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.3
  • WordPress version: 6.3.1
  • First release: Oct 4, 2011
  • Latest release: Aug 10, 2023
  • Number of updates: 106
  • Update frequency: every 40.8 days
  • Top authors: mousesports (55.66%)WebFactory (45.28%)

Code review

54 tests

User reviews

76 reviews

Install metrics

30,000+ active /1,359,451 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼3.30ms] Passed 4 tests

This is a short check of server-side resources used by Database Reset
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2139.19 ▼1.36
Dashboard /wp-admin3.47 ▲0.1750.63 ▼0.30
Posts /wp-admin/edit.php3.58 ▲0.2352.98 ▲3.41
Add New Post /wp-admin/post-new.php6.05 ▲0.1790.69 ▼14.93
Media Library /wp-admin/upload.php3.39 ▲0.1741.07 ▲5.52
Database Reset /wp-admin/tools.php?page=database-reset3.3836.26

Server storage [IO: ▲0.25MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 32 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Database Reset
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.19 ▼1.172.00 ▼0.0542.45 ▲1.89
Dashboard /wp-admin2,210 ▲224.82 ▼0.10104.90 ▼31.5141.21 ▼5.23
Posts /wp-admin/edit.php2,096 ▲72.01 ▲0.0137.58 ▼1.9132.54 ▼0.64
Add New Post /wp-admin/post-new.php1,545 ▲1723.01 ▲4.70634.11 ▲9.5454.42 ▲7.31
Media Library /wp-admin/upload.php1,392 ▲44.25 ▲0.13109.98 ▼5.4246.39 ▲0.97
Database Reset /wp-admin/tools.php?page=database-reset1,2142.6647.2851.07

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 12× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wordpress-database-reset/views/index.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/wordpress-database-reset/class-db-reset-command.php:6
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/wordpress-database-reset/lib/helpers.php on line 50
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/wordpress-database-reset/lib/helpers.php on line 50
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wordpress-database-reset/views/partials/notice.php:1
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/wordpress-database-reset/lib/helpers.php on line 50
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wordpress-database-reset/lib/helpers.php on line 50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wordpress-database-reset/views/partials/select-tables.php:5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wordpress-database-reset/lib/helpers.php on line 50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wordpress-database-reset/views/partials/security-code.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: database, database reset, wp reset, reset, developer...

wordpress-database-reset/wp-reset.php 92% from 13 tests

The main PHP file in "Database Reset" ver. 3.22 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wordpress-database-reset.php" instead of "wp-reset.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin1,618 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP152561091,200
CSS35114309
JavaScript53426109

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity11.00
▷ Minimum class complexity2.00
▷ Maximum class complexity21.00
Average method complexity1.74
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods78
▷ Static methods11.28%
▷ Public methods3342.31%
▷ Protected methods00.00%
▷ Private methods4557.69%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
wf-flyout/icons/db-reset.png5.72KB3.12KB▼ 45.46%
assets/images/wp-reset-icon.png3.11KB2.28KB▼ 26.85%
wf-flyout/icons/ucp.png16.30KB2.35KB▼ 85.58%
wf-flyout/icons/wp-reset.png3.11KB2.28KB▼ 26.85%
assets/images/wp-reset-logo.png10.48KB4.02KB▼ 61.60%