10% zoom-widget

Code Review | Z

WordPress plugin Z scored 10% from 54 tests.

About plugin

  • Plugin page: zoom-widget
  • Plugin version: 1.2.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.0
  • WordPress version: 5.8.1
  • First release: Feb 9, 2012
  • Latest release: Dec 16, 2019
  • Number of updates: 79
  • Update frequency: every 36.3 days
  • Top authors: webdorado (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

2,000+ active / 64,461 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/zoom-widget/zoom_widget.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; zoom_widget has a deprecated constructor

Server metrics [RAM: ▲0.02MB] [CPU: ▼145.61ms] Passed 4 tests

This is a short check of server-side resources used by Z
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1329.83 ▲7.73
Dashboard /wp-admin3.08 ▲0.0241.84 ▼4.80
Posts /wp-admin/edit.php3.13 ▲0.0237.95 ▼5.30
Add New Post /wp-admin/post-new.php5.44 ▲0.0081.20 ▼569.54
Media Library /wp-admin/upload.php3.02 ▲0.0228.41 ▼2.78

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 9 new options
New WordPress options
Spider_Zoom_max
Spider_Zoom_min
Spider_Zoom_class
Spider_Zoom_imgsize
Spider_Zoom_imggroup
Spider_Zoom_title
widget_zoom_widget
Spider_Zoom_tag
Spider_Zoom_id

Browser metrics Passed 4 tests

An overview of browser requirements for Z
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,726 ▲8915.73 ▼0.108.77 ▲0.3246.63 ▲2.12
Dashboard /wp-admin2,993 ▲625.85 ▼0.07134.34 ▼0.54102.14 ▼11.83
Posts /wp-admin/edit.php2,762 ▲232.70 ▲0.0064.69 ▼0.6286.94 ▼1.47
Add New Post /wp-admin/post-new.php1,888 ▼16919.06 ▼0.30349.28 ▼12.16121.41 ▲15.14
Media Library /wp-admin/upload.php1,832 ▲255.03 ▲0.00143.94 ▼20.29113.47 ▼3.02

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 were found after uninstall: 1 option
    • widget_zoom_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/zoom-widget/zoom.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/zoom-widget/zoom_widget.php:3

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, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
There were no plugin tags found

zoom-widget/zoom.php 92% from 13 tests

"Z" version 1.2.8'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: The principal plugin file should be the same as the plugin slug ("zoom-widget.php" instead of "zoom.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected10,365 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript72,0791,4848,216
PHP10390241,554
CSS242164594
HTML1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
8 PNG files occupy 0.11MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/Spider_ZoomLogo.png3.17KB0.66KB▼ 79.08%
images/Spider_ZoomLogoHover.png3.22KB0.68KB▼ 78.99%
elements/images/1/100.png9.44KB4.75KB▼ 49.70%
elements/images/1/minus.png4.19KB1.37KB▼ 67.28%
screenshot-1.png5.17KB2.92KB▼ 43.54%