84% optimize-database

Code Review | Optimize Database

WordPress plugin Optimize Database scored84%from 54 tests.

About plugin

  • Plugin page: optimize-database
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-5.6
  • WordPress version: 6.3.1
  • First release: Jun 8, 2014
  • Latest release: Nov 24, 2020
  • Number of updates: 9
  • Update frequency: every 262.6 days
  • Top authors: joshf (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /3,944 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼0.43ms] Passed 4 tests

A check of server-side resources used by Optimize Database
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.82 ▼2.05
Dashboard /wp-admin3.32 ▲0.0255.43 ▲5.11
Posts /wp-admin/edit.php3.37 ▲0.0150.26 ▲0.12
Add New Post /wp-admin/post-new.php5.90 ▲0.0198.50 ▲7.21
Media Library /wp-admin/upload.php3.24 ▲0.0132.48 ▼4.91

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Optimize Database: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.23 ▼0.052.15 ▲0.5545.57 ▼0.15
Dashboard /wp-admin2,198 ▲205.65 ▲0.0685.69 ▼14.7839.94 ▲0.32
Posts /wp-admin/edit.php2,100 ▲31.99 ▼0.0341.23 ▲2.9834.41 ▼3.04
Add New Post /wp-admin/post-new.php1,536 ▲1023.11 ▲0.06580.39 ▼134.6147.41 ▼7.29
Media Library /wp-admin/upload.php1,391 ▼64.20 ▼0.0199.44 ▼4.9046.51 ▲0.72

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/optimize-database/optimize-database.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === optimize-database === )
You can look at the official readme.txt

optimize-database/optimize-database.php Passed 13 tests

The principal PHP file in "Optimize Database" v. 1.0.4 is loaded by WordPress automatically on each request
46 characters long description:
Automatically optimize the database every day.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin33 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1102433

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin