73% emc2-alert-boxes

Code Review | EMC2 Alert Boxes

WordPress plugin EMC2 Alert Boxes scored73%from 54 tests.

About plugin

  • Plugin page: emc2-alert-boxes
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-3.4.2
  • WordPress version: 6.3.1
  • First release: Oct 22, 2012
  • Latest release: Oct 29, 2012
  • Number of updates: 21
  • Update frequency: every 0.9 days
  • Top authors: emcniece (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active /4,852 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

Analyzing server-side resources used by EMC2 Alert Boxes
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0351.37 ▼3.71
Dashboard /wp-admin3.33 ▲0.0251.00 ▼0.17
Posts /wp-admin/edit.php3.38 ▲0.0257.64 ▲1.05
Add New Post /wp-admin/post-new.php5.91 ▲0.0295.77 ▼13.00
Media Library /wp-admin/upload.php3.25 ▲0.0235.50 ▼4.96
EMC2 Alert Settings /wp-admin/admin.php?page=emc2alert_options3.1935.15

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

EMC2 Alert Boxes: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,902 ▲14113.72 ▼0.6310.17 ▲7.8840.27 ▼27.06
Dashboard /wp-admin2,224 ▲184.85 ▼1.06114.61 ▲5.2643.09 ▲4.30
Posts /wp-admin/edit.php2,106 ▲62.03 ▼0.0038.13 ▼6.0336.72 ▼1.99
Add New Post /wp-admin/post-new.php1,547 ▲222.90 ▼0.14717.14 ▲33.0055.34 ▼20.18
Media Library /wp-admin/upload.php1,403 ▲64.27 ▲0.0498.12 ▼9.1648.14 ▲1.48
EMC2 Alert Settings /wp-admin/admin.php?page=emc2alert_options8032.0524.0329.81

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=emc2alert_options
    • > Notice in wp-content/plugins/emc2-alert-boxes/emc2alert-options.php+4
    Undefined index: phone_home

SRP 0% 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/emc2-alert-boxes/emc2alert_popup.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/emc2-alert-boxes/emc2-alert-boxes.php on line 13
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/emc2-alert-boxes/emc2-alert-boxes.php on line 13
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/emc2-alert-boxes/emc2-alert-boxes.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (Theme-side box view.), #2 (TinyMCE shortcode creation interface.)
Please take inspiration from this readme.txt

emc2-alert-boxes/emc2-alert-boxes.php Passed 13 tests

The main PHP script in "EMC2 Alert Boxes" version 1.3 is automatically included on every request by WordPress
31 characters long description:
Fancy alert boxes for WordPress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected407 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP34165235
CSS19694
JavaScript2223778

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
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

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
alert.png10.37KB4.76KB▼ 54.14%
screenshot-1.png33.04KB13.61KB▼ 58.81%
close.png0.26KB0.17KB▼ 33.71%
screenshot-2.png12.04KB5.11KB▼ 57.55%