84% wp-smart-variations

Code Review | WP Smart Variations

WordPress plugin WP Smart Variations scored84%from 54 tests.

About plugin

  • Plugin page: wp-smart-variations
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 6.3.1
  • First release: Oct 13, 2014
  • Latest release: Jan 23, 2018
  • Number of updates: 6
  • Update frequency: every 199.7 days
  • Top authors: rajanit2000 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,984 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

Analyzing server-side resources used by WP Smart Variations
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.94 ▲3.90
Dashboard /wp-admin3.31 ▲0.0053.80 ▲10.99
Posts /wp-admin/edit.php3.36 ▲0.0060.27 ▲15.47
Add New Post /wp-admin/post-new.php5.89 ▲0.00129.79 ▲29.12
Media Library /wp-admin/upload.php3.23 ▲0.0040.09 ▼5.48

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

WP Smart Variations: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.28 ▼0.974.33 ▲2.6644.78 ▲3.34
Dashboard /wp-admin2,206 ▲185.91 ▲1.03110.52 ▼14.1136.40 ▼19.01
Posts /wp-admin/edit.php2,092 ▲31.99 ▼0.0639.92 ▲2.7542.48 ▲8.87
Add New Post /wp-admin/post-new.php1,514 ▼1617.62 ▼3.68686.77 ▼118.1485.79 ▼1.39
Media Library /wp-admin/upload.php1,385 ▼34.23 ▲0.06115.93 ▼15.8846.06 ▼2.61

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-smart-variations/install.php:27

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 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #1 (screenshot-1.png)
Please take inspiration from this readme.txt

wp-smart-variations/install.php 92% from 13 tests

"WP Smart Variations" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-smart-variations.php" instead of "install.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin38 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP182036
CSS1002

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.00
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
Namespaces0
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%
Functions2
▷ Named functions2100.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
1 PNG file occupies 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png80.37KB32.04KB▼ 60.13%