10% n0tice-for-wordpress

Code Review | n0tice for WordPress

WordPress plugin n0tice for WordPress scored10%from 54 tests.

About plugin

  • Plugin page: n0tice-for-wordpress
  • Plugin version: 0.2b...
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-3.3.2
  • WordPress version: 6.3.1
  • First release: May 22, 2012
  • Latest release: May 23, 2012
  • Number of updates: 14
  • Update frequency: every 0.1 days
  • Top authors: aendrew (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,123 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Parse error in wp-content/plugins/n0tice-for-wordpress/n0tice.php+449
    syntax error, unexpected 'add_action' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.07ms] Passed 4 tests

This is a short check of server-side resources used by n0tice for WordPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.11 ▼2.80
Dashboard /wp-admin3.31 ▲0.0044.88 ▼4.71
Posts /wp-admin/edit.php3.36 ▲0.0044.24 ▼4.13
Add New Post /wp-admin/post-new.php5.89 ▲0.0096.65 ▼4.64
Media Library /wp-admin/upload.php3.23 ▲0.0033.42 ▼1.45

Server storage [IO: ▲0.27MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for n0tice for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.34 ▼0.954.28 ▲2.5340.55 ▼2.76
Dashboard /wp-admin2,206 ▲215.85 ▲0.97100.50 ▼16.5743.01 ▼2.95
Posts /wp-admin/edit.php2,092 ▲32.05 ▲0.0435.17 ▼3.1930.90 ▼1.52
Add New Post /wp-admin/post-new.php1,528 ▼618.35 ▼4.75623.73 ▲18.2654.84 ▲5.73
Media Library /wp-admin/upload.php1,391 ▲94.25 ▲0.0997.94 ▼1.6543.11 ▼2.05

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/n0tice-for-wordpress/install.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/n0tice-for-wordpress/install.php on line 26
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/n0tice-for-wordpress/install.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/n0tice-for-wordpress/install.php on line 26
    • > PHP Parse error
      syntax error, unexpected 'add_action' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in wp-content/plugins/n0tice-for-wordpress/n0tice.php on line 449
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/n0tice-for-wordpress/install.php on line 26

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 on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Screenshot showing a listing of n0tice curations.), #2 (Screenshot showing curated items, in addition to a new search dialog.)
You can take inspiration from this readme.txt

n0tice-for-wordpress/n0tice.php 85% from 13 tests

The entry point to "n0tice for WordPress" version 0.2b... is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("n0tice-for-wordpress.php" instead of "n0tice.php")
  • Version: Use only periods and digits for the version number (ex. "1.0.3" instead of "0.2b...")

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
Good job! No executable or dangerous file extensions detected596 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP47172359
JavaScript1219153
Markdown129053
CSS16631

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity10.00
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity7.00
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
4 PNG files occupy 0.24MB with 0.16MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/222222_256x240_icons_icons.png10.32KB5.76KB▼ 44.20%
screenshot-2.png146.42KB48.46KB▼ 66.90%
img/n0tice.png3.68KB0.52KB▼ 85.95%
screenshot-1.png82.86KB25.18KB▼ 69.61%