84% force-default-variable

Code Review | Force Default Variable

WordPress plugin Force Default Variable scored84%from 54 tests.

About plugin

  • Plugin page: force-default-var...
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.4-6.0
  • WordPress version: 6.3.1
  • First release: Jun 2, 2022
  • Latest release: Jun 2, 2022
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: mehranyavari (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /345 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
Installer ran successfully

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

A check of server-side resources used by Force Default Variable
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.05 ▼6.51
Dashboard /wp-admin3.32 ▼0.0345.58 ▼16.51
Posts /wp-admin/edit.php3.37 ▲0.0148.10 ▲3.46
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.05 ▼9.12
Media Library /wp-admin/upload.php3.24 ▲0.0134.61 ▲2.91

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 9 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 Force Default Variable
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲5413.25 ▼1.401.90 ▼0.2940.93 ▼4.48
Dashboard /wp-admin2,206 ▲154.80 ▼1.0696.93 ▼20.2941.49 ▼2.60
Posts /wp-admin/edit.php2,092 ▲62.00 ▲0.0038.90 ▲3.2836.78 ▲2.32
Add New Post /wp-admin/post-new.php1,523 ▲323.35 ▲0.35647.88 ▼23.6352.27 ▼10.49
Media Library /wp-admin/upload.php1,391 ▲34.20 ▼0.0795.90 ▼12.9740.97 ▼6.74

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • 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 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/force-default-variable/inc/variables.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/force-default-variable/inc/settings.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: ecommerce, variable product, woocommerce, default variable, woocommerce variable

force-default-variable/force-default-variable.php 85% from 13 tests

The entry point to "Force Default Variable" version 1.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.7" instead of "2.4")
  • Text Domain: The text domain should only use lowercase characters and dashes

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
There were no executable files found in this plugin505 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP37525352
PO File24648153

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin