78% notice-boxes-with-shortcodes

Code Review | Notice Boxes with Shortcodes

WordPress plugin Notice Boxes with Shortcodes scored 78% from 54 tests.

About plugin

  • Plugin page: notice-boxes-with...
  • Plugin version: 3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.6
  • WordPress version: 5.8.1
  • First release: Aug 29, 2013
  • Latest release: Sep 21, 2013
  • Number of updates: 24
  • Update frequency: every 1.0 days
  • Top authors: ayushag96 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 3,974 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.91MB] [CPU: ▼172.47ms] Passed 4 tests

Analyzing server-side resources used by Notice Boxes with Shortcodes
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1234.25 ▲11.38
Dashboard /wp-admin2.74 ▼0.3219.61 ▼21.67
Posts /wp-admin/edit.php2.74 ▼0.3720.65 ▼22.47
Add New Post /wp-admin/post-new.php2.74 ▼2.6921.08 ▼625.20
Media Library /wp-admin/upload.php2.74 ▼0.2720.25 ▼20.52
Notice Boxes /wp-admin/options-general.php?page=noticeboxes2.7422.55

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Notice Boxes with Shortcodes
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,796 ▲20016.31 ▲0.8614.15 ▲5.1748.72 ▲1.39
Dashboard /wp-admin2,972 ▲386.14 ▲0.03133.21 ▼11.36111.60 ▼4.01
Posts /wp-admin/edit.php2,741 ▲52.71 ▼0.0160.09 ▲1.3291.21 ▼3.78
Add New Post /wp-admin/post-new.php1,501 ▼2,13518.82 ▲3.82364.59 ▼58.14109.46 ▲2.07
Media Library /wp-admin/upload.php1,818 ▲115.05 ▲0.03150.97 ▲0.61116.51 ▼9.73
Notice Boxes /wp-admin/options-general.php?page=noticeboxes1,2192.0551.0170.88

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5495
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=noticeboxes
    • > User deprecated in wp-includes/functions.php+5495
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

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
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/notice-boxes-with-shortcodes/nbox_adminpage.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/notice-boxes-with-shortcodes/notice-boxes.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
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 important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === notice-boxes-with-shortcodes === )
You can look at the official readme.txt

notice-boxes-with-shortcodes/notice-boxes.php 92% from 13 tests

"Notice Boxes with Shortcodes" version 3.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("notice-boxes-with-shortcodes.php" instead of "notice-boxes.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
No dangerous file extensions were detected32 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP211223
JavaScript1108
CSS1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions5
▷ Named functions5100.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.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ss2.png22.67KB5.99KB▼ 73.57%
images/ss3.png11.15KB2.84KB▼ 74.55%
images/ss4.png10.05KB2.32KB▼ 76.97%
images/ss1.png8.26KB1.54KB▼ 81.31%