83% basic-optimization

Code Review | Basic Optimization

WordPress plugin Basic Optimization scored83%from 54 tests.

About plugin

  • Plugin page: basic-optimization
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.5
  • WordPress version: 6.3.1
  • First release: Aug 11, 2020
  • Latest release: Aug 12, 2020
  • Number of updates: 8
  • Update frequency: every 0.9 days
  • Top authors: shahalom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /530 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼8.81ms] Passed 4 tests

This is a short check of server-side resources used by Basic Optimization
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0346.20 ▼2.65
Dashboard /wp-admin3.32 ▲0.0255.25 ▲0.91
Posts /wp-admin/edit.php3.37 ▲0.0250.72 ▼4.90
Add New Post /wp-admin/post-new.php5.90 ▲0.0287.20 ▼28.58
Media Library /wp-admin/upload.php3.24 ▲0.0239.98 ▲2.75

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 11 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
basic_optimization_hide_wp_version
basic_optimization_stop_heartbeat
can_compress_scripts
basic_optimization_installed
basic_optimization_disable_emoticons
widget_recent-posts
db_upgraded
widget_recent-comments
...

Browser metrics Passed 4 tests

A check of browser resources used by Basic Optimization
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.34 ▼0.021.81 ▼0.1445.13 ▼2.75
Dashboard /wp-admin2,211 ▲315.53 ▼0.1590.05 ▲1.0937.98 ▼3.07
Posts /wp-admin/edit.php2,116 ▲132.04 ▲0.0435.47 ▼5.6333.47 ▼4.78
Add New Post /wp-admin/post-new.php1,547 ▲1918.21 ▼4.94678.84 ▲56.1870.66 ▲11.29
Media Library /wp-admin/upload.php1,419 ▲164.10 ▼0.0897.98 ▼5.8444.57 ▼1.77

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: 11 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • basic_optimization_disable_emoticons
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • basic_optimization_installed
    • basic_optimization_version
    • basic_optimization_stop_heartbeat
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Trait 'Basic\\Optimization\\Traits\\Form_Error' not found in wp-content/plugins/basic-optimization/includes/Admin/GeneralSettings.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/basic-optimization/includes/Admin/views/general-settings.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (13 tag instead of maximum 10)
You can look at the official readme.txt

basic-optimization/main.php 77% from 13 tests

Analyzing the main PHP file in "Basic Optimization" version 1.0
The following require your attention:
  • Domain Path: The domain path folder was not found ("/languages")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 373 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("basic-optimization.php" instead of "main.php")

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
There were no executable files found in this plugin786 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP16191416765
JSON20021

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity8.70
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits1
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes111.11%
Methods53
▷ Static methods35.66%
▷ Public methods5196.23%
▷ Protected methods00.00%
▷ Private methods23.77%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants583.33%
▷ Class constants116.67%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin