84% w3dev-fancybox

Code Review | fancyBox 3 for Wordpress

WordPress plugin fancyBox 3 for Wordpress scored84%from 54 tests.

About plugin

  • Plugin page: w3dev-fancybox
  • Plugin version: 1.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-6.3.2
  • WordPress version: 6.3.1
  • First release: Sep 24, 2017
  • Latest release: Nov 7, 2023
  • Number of updates: 19
  • Update frequency: every 117.8 days
  • Top authors: w3dev (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /11,153 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.06MB] [CPU: ▼1.16ms] Passed 4 tests

Server-side resources used by fancyBox 3 for Wordpress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0539.93 ▼1.34
Dashboard /wp-admin3.38 ▲0.0747.29 ▼5.35
Posts /wp-admin/edit.php3.43 ▲0.0748.96 ▲3.87
Add New Post /wp-admin/post-new.php5.96 ▲0.0783.91 ▼1.76
Media Library /wp-admin/upload.php3.30 ▲0.0739.85 ▲3.83
fancyBox 3 /wp-admin/options-general.php?page=fancybox-3-for-wordpress3.3230.75

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 17 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
fb3fw_active_version
widget_recent-posts
fb3fw

Browser metrics Passed 4 tests

A check of browser resources used by fancyBox 3 for Wordpress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4314.09 ▼0.164.08 ▲2.2546.07 ▼2.03
Dashboard /wp-admin2,199 ▲225.49 ▼0.1087.96 ▼13.0439.96 ▼4.92
Posts /wp-admin/edit.php2,104 ▲72.00 ▲0.0437.44 ▼0.0736.53 ▼2.77
Add New Post /wp-admin/post-new.php1,529 ▲123.27 ▲0.36685.68 ▲16.5359.92 ▲6.92
Media Library /wp-admin/upload.php1,407 ▲44.19 ▼0.0095.23 ▼6.3643.12 ▼1.36
fancyBox 3 /wp-admin/options-general.php?page=fancybox-3-for-wordpress1,3102.0126.6927.69

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/w3dev-fancybox/fancybox-3-for-wordpress.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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 require attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

w3dev-fancybox/fancybox-3-for-wordpress.php 92% from 13 tests

The main PHP file in "fancyBox 3 for Wordpress" ver. 1.2.4 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("w3dev-fancybox.php" instead of "fancybox-3-for-wordpress.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin6,912 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript31,1096143,948
CSS3155942,488
PHP2818476

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.49
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%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
6 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_cc0000_256x240.png4.44KB4.17KB▼ 6.02%
css/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
css/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
css/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%
css/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%