90% pofw-option-default

Code Review | POFW Option Default

WordPress plugin POFW Option Default scored90%from 54 tests.

About plugin

  • Plugin page: pofw-option-default
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1
  • WordPress version: 6.3.1
  • First release: Jun 2, 2020
  • Latest release: Nov 8, 2022
  • Number of updates: 3
  • Update frequency: every 296.4 days
  • Top authors: pektsekye (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /430 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.67ms] Passed 4 tests

This is a short check of server-side resources used by POFW Option Default
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.10 ▲0.24
Dashboard /wp-admin3.31 ▲0.0048.01 ▼1.10
Posts /wp-admin/edit.php3.36 ▲0.0051.23 ▲2.83
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.29 ▼23.22
Media Library /wp-admin/upload.php3.23 ▲0.0032.38 ▼2.59

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for POFW Option Default
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.58 ▼0.831.77 ▲0.1243.08 ▼4.23
Dashboard /wp-admin2,209 ▲244.84 ▼0.04108.91 ▼10.6636.02 ▼5.96
Posts /wp-admin/edit.php2,092 ▲32.01 ▼0.1739.01 ▼1.6536.21 ▲1.31
Add New Post /wp-admin/post-new.php1,514 ▼2817.55 ▼0.61664.59 ▲74.7950.02 ▲1.56
Media Library /wp-admin/upload.php1,388 ▲34.33 ▲0.1494.52 ▼3.4742.17 ▼3.19

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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 SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
2 plugin tags: product options, selected by default

pofw-option-default/pofw-option-default.php Passed 13 tests

The main file in "POFW Option Default" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
47 characters long description:
Allows to preselect product options by default.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin651 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP1222819573
JavaScript223061
CSS19017

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity10.00
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity2.65
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes111.11%
Methods49
▷ Static methods48.16%
▷ Public methods4591.84%
▷ Protected methods00.00%
▷ Private methods48.16%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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