83% wplb-widget-total

Code Review | WPLB Widget Total

WordPress plugin WPLB Widget Total scored 83% from 53 tests.

About plugin

  • Plugin page: wplb-widget-total
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2.2
  • WordPress version: 5.8.1
  • First release: Jul 14, 2015
  • Latest release: Aug 13, 2015
  • Number of updates: 16
  • Update frequency: every 1.9 days
  • Top authors: HuuHa (100%)

Code review

53 tests

User reviews

2 reviews

Install metrics

50+ active / 935 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.58MB] [CPU: ▼272.05ms] Passed 4 tests

An overview of server-side resources used by WPLB Widget Total
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.40 ▲0.6831.78 ▲7.98
Dashboard /wp-admin3.71 ▲0.6639.94 ▼2.41
Posts /wp-admin/edit.php3.60 ▲0.5033.43 ▼19.31
Add New Post /wp-admin/post-new.php6.01 ▲0.5896.27 ▼1,057.28
Media Library /wp-admin/upload.php3.59 ▲0.5930.57 ▼9.18

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 58 new files
Database: no new tables, 9 new options
New WordPress options
widget_wplb-widget-featured
widget_wplb-fb-box-widget
widget_wplb-post-type-retaled-widget
widget_wplb-maps-widget
widget_wplb-list-posts-widget
widget_wplb-image-widget
widget_wplb-socials-widget
widget_wplb-video-widget
widget_wplb-custom-taxonomy-widget

Browser metrics Passed 4 tests

Checking browser requirements for WPLB Widget Total
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,793 ▲18717.52 ▲1.6220.65 ▲10.0555.52 ▲1.35
Dashboard /wp-admin2,931 ▲815.89 ▲0.01146.97 ▲8.43111.30 ▲3.36
Posts /wp-admin/edit.php2,735 ▲292.69 ▲0.0075.52 ▲0.5199.55 ▲4.64
Add New Post /wp-admin/post-new.php1,853 ▲19719.13 ▲0.85390.94 ▲4.04109.39 ▼4.97
Media Library /wp-admin/upload.php1,775 ▲35.02 ▲0.03151.93 ▲2.18112.17 ▼9.28

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_wplb-maps-widget
    • widget_wplb-widget-featured
    • widget_wplb-custom-taxonomy-widget
    • widget_wplb-fb-box-widget
    • widget_wplb-list-posts-widget
    • widget_wplb-image-widget
    • widget_wplb-video-widget
    • widget_wplb-post-type-retaled-widget
    • widget_wplb-socials-widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WPLB_Widgets' not found in wp-content/plugins/wplb-widget-total/class/WPLB_Widget_Image.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WPLB_Widgets' not found in wp-content/plugins/wplb-widget-total/class/WPLB_Widget_Video.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WPLB_Widgets' not found in wp-content/plugins/wplb-widget-total/class/WPLB_Widget_Facebook_Box.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wplb-widget-total/wplb-widgets.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'WPLB_Widgets' not found in wp-content/plugins/wplb-widget-total/class/WPLB_Widget_Maps.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WPLB_Widgets' not found in wp-content/plugins/wplb-widget-total/class/WPLB_Widget_Custom_Post.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WPLB_Widgets' not found in wp-content/plugins/wplb-widget-total/class/WPLB_Widget_Taxonomy.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WPLB_Widgets' not found in wp-content/plugins/wplb-widget-total/class/WPLB_Widget_Custom_Post_Related.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WPLB_Widgets' not found in wp-content/plugins/wplb-widget-total/class/WPLB_Widget_Featured.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WPLB_Widgets' not found in wp-content/plugins/wplb-widget-total/class/WPLB_Widget_Socials.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed: The official readme.txt is a good inspiration

wplb-widget-total/wplb-widgets.php 85% from 13 tests

"WPLB Widget Total" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wplb-widget-total.php" instead of "wplb-widgets.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 187 characters long)

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
There were no executable files found in this plugin5,487 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP127354402,523
JavaScript73284222,483
PO File1131322290
CSS252191

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity21.58
▷ Minimum class complexity7.00
▷ Maximum class complexity63.00
Average method complexity5.26
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods58
▷ Static methods11.72%
▷ Public methods4781.03%
▷ Protected methods1118.97%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 0% from 1 test

Image compression 0% from 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
32 PNG files occupy 1.44MB with 0.67MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/flickr.png0.72KB0.66KB▼ 8.36%
images/markers/black.png2.65KB1.63KB▼ 38.41%
screenshot-4.png265.86KB85.46KB▼ 67.86%
images/markers/pin.png4.26KB1.39KB▼ 67.41%
images/pinterest_16.png1.68KB0.84KB▼ 49.94%