89% simple-widget-factory

Code Review | Simple Widget Factory Plugin

WordPress plugin Simple Widget Factory Plugin scored89%from 54 tests.

About plugin

  • Plugin page: simple-widget-fac...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.4-5.2
  • WordPress version: 6.3.1
  • First release: Jun 17, 2019
  • Latest release: Jun 17, 2019
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: tridibdawn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /479 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Simple Widget Factory Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.81 ▲0.32
Dashboard /wp-admin3.31 ▲0.0146.15 ▼2.93
Posts /wp-admin/edit.php3.36 ▲0.0145.94 ▲0.48
Add New Post /wp-admin/post-new.php5.91 ▲0.0380.97 ▼0.32
Media Library /wp-admin/upload.php3.24 ▲0.0144.54 ▲12.12

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Simple Widget Factory Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6913.69 ▼0.691.60 ▼0.1342.91 ▼5.53
Dashboard /wp-admin2,221 ▲365.79 ▼0.11101.08 ▼17.2984.42 ▲41.69
Posts /wp-admin/edit.php2,107 ▲181.99 ▼0.0637.52 ▲1.3935.03 ▼0.58
Add New Post /wp-admin/post-new.php1,681 ▲16021.95 ▼1.30620.57 ▲18.7344.24 ▼8.16
Media Library /wp-admin/upload.php1,406 ▲214.22 ▼0.0998.15 ▲0.4579.91 ▲35.71

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Looking good! No server-side errors or output on direct access of PHP files

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
4 plugin tags: custom widgets, wordpress, wordpressorg, widget factory

simple-widget-factory/simple-widget-factory.php 92% from 13 tests

"Simple Widget Factory Plugin" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin214 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1053174
CSS10038
JavaScript1102

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity18.00
▷ Minimum class complexity18.00
▷ Maximum class complexity18.00
Average method complexity3.83
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 0.53MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot/5.png46.61KB13.01KB▼ 72.08%
screenshot/4.png48.84KB13.19KB▼ 73.00%
images/widgets.png0.66KB0.45KB▼ 31.46%
screenshot/1.png7.21KB4.19KB▼ 41.80%
screenshot/6.png54.87KB13.88KB▼ 74.70%