73% elegance-modal-box

Code Review | Elegance Modal Box

WordPress plugin Elegance Modal Box scored73%from 54 tests.

About plugin

  • Plugin page: elegance-modal-box
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.1.0
  • WordPress version: 6.3.1
  • First release: Dec 17, 2014
  • Latest release: Dec 27, 2014
  • Number of updates: 81
  • Update frequency: every 0.1 days
  • Top authors: elegancenet (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active /11,164 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.93MB] [CPU: ▼32.83ms] Passed 4 tests

A check of server-side resources used by Elegance Modal Box
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0033.76 ▼5.77
Dashboard /wp-admin3.02 ▼0.2922.86 ▼25.08
Posts /wp-admin/edit.php3.02 ▼0.3425.28 ▼21.35
Add New Post /wp-admin/post-new.php3.02 ▼2.8722.39 ▼72.56
Media Library /wp-admin/upload.php3.02 ▼0.2123.23 ▼12.33

Server storage [IO: ▲0.24MB] [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: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Elegance Modal Box
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,852 ▲11713.49 ▼1.261.69 ▼0.3239.01 ▼6.12
Dashboard /wp-admin2,255 ▲675.31 ▼0.60104.67 ▲0.3240.86 ▼2.40
Posts /wp-admin/edit.php2,157 ▲682.36 ▲0.3339.41 ▼1.2642.46 ▲4.98
Add New Post /wp-admin/post-new.php1,572 ▲3023.20 ▲5.06660.65 ▲30.8036.57 ▼12.64
Media Library /wp-admin/upload.php1,453 ▲684.61 ▲0.4098.81 ▼1.7644.49 ▲0.59

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

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 | 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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/elegance-modal-box/elegance-modal.php:22
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/elegance-modal-box/elegance-modal-admin.php on line 353

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (13 tag instead of maximum 10)
  • Screenshots: These screenshots require images: #1 (This is simply how your box will appear when a user enters your site:), #2 (This is the wp-admin setup section for Elegance Modal)
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === elegance-modal-box === )
The official readme.txt is a good inspiration

elegance-modal-box/elegance-modal.php 85% from 13 tests

"Elegance Modal Box" version 1.2.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("elegance-modal-box.php" instead of "elegance-modal.php")
  • Description: The description should be shorter than 140 characters (currently 183 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected2,302 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript42643101,886
PHP211621363
CSS22153

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.20
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.14MB with 0.06MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/banner.png144.54KB80.94KB▼ 44.00%