67% wp-notices

Code Review | WP Notices

WordPress plugin WP Notices scored67%from 54 tests.

About plugin

  • Plugin page: wp-notices
  • Plugin version: 1.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.6.1
  • WordPress version: 6.3.1
  • First release: Jul 1, 2016
  • Latest release: Sep 9, 2016
  • Number of updates: 13
  • Update frequency: every 5.5 days
  • Top authors: leehodson (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,118 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼1.31ms] Passed 4 tests

Server-side resources used by WP Notices
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1041.57 ▲3.79
Dashboard /wp-admin3.40 ▲0.1048.98 ▲3.82
Posts /wp-admin/edit.php3.52 ▲0.1645.03 ▼2.10
Add New Post /wp-admin/post-new.php5.98 ▲0.1080.67 ▼7.67
Media Library /wp-admin/upload.php3.33 ▲0.1036.12 ▲0.74

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 244 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
vr_wp_notices_dompdf
vr_wp_notices_directory_url
vr_wp_notices_directory
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WP Notices
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7914.80 ▲0.411.99 ▲0.3045.00 ▼2.05
Dashboard /wp-admin2,209 ▲215.90 ▲0.99104.82 ▼7.8237.39 ▼5.55
Posts /wp-admin/edit.php2,089 ▲32.01 ▼0.0333.66 ▼3.4731.51 ▼4.66
Add New Post /wp-admin/post-new.php1,533 ▲1423.33 ▲0.18616.28 ▼72.1955.46 ▼12.68
Media Library /wp-admin/upload.php1,391 ▲34.19 ▲0.0399.78 ▼7.6843.15 ▼2.94

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin cannot be uninstalled
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'vr_wp_notices_deactivate' not found or invalid function name
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-notices/css/index.php
    • > /wp-content/plugins/wp-notices/includes/index.php
    • > /wp-content/plugins/wp-notices/index.php
    • > /wp-content/plugins/wp-notices/js/index.php
  • 109× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/wp-notices/includes/b0c753d17d029f85e573ce22e6b9663b73fd1e35/dompdf/dompdf/src/FrameDecorator/Table.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\BinaryStream' not found in wp-content/plugins/wp-notices/includes/b0c753d17d029f85e573ce22e6b9663b73fd1e35/phenx/php-font-lib/src/FontLib/Table/DirectoryEntry.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/wp-notices/includes/b0c753d17d029f85e573ce22e6b9663b73fd1e35/phenx/php-font-lib/src/FontLib/Table/Type/os2.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/wp-notices/includes/b0c753d17d029f85e573ce22e6b9663b73fd1e35/phenx/php-font-lib/src/FontLib/Table/Type/kern.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\Group' not found in wp-content/plugins/wp-notices/includes/b0c753d17d029f85e573ce22e6b9663b73fd1e35/phenx/php-svg-lib/src/Svg/Tag/Anchor.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Svg\\Surface\\SurfaceInterface' not found in wp-content/plugins/wp-notices/includes/b0c753d17d029f85e573ce22e6b9663b73fd1e35/phenx/php-svg-lib/src/Svg/Surface/SurfaceCpdf.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Header' not found in wp-content/plugins/wp-notices/includes/b0c753d17d029f85e573ce22e6b9663b73fd1e35/phenx/php-font-lib/src/FontLib/TrueType/Header.php:16
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/wp-notices/includes/b0c753d17d029f85e573ce22e6b9663b73fd1e35/dompdf/dompdf/lib/Cpdf.php on line 461
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/wp-notices/includes/b0c753d17d029f85e573ce22e6b9663b73fd1e35/dompdf/dompdf/src/FrameDecorator/Block.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Svg\\Surface\\SurfaceInterface' not found in wp-content/plugins/wp-notices/includes/b0c753d17d029f85e573ce22e6b9663b73fd1e35/phenx/php-svg-lib/src/Svg/Surface/SurfaceGmagick.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% 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:
  • Screenshots: Screenshot #1 (Info Message) image missing
The official readme.txt is a good inspiration

wp-notices/index.php 85% from 13 tests

The entry point to "WP Notices" version 1.2.4 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 254 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-notices.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin30,555 lines of code in 172 files:
LanguageFilesBlank linesComment linesLines of code
PHP1547,86213,02229,280
CSS29342456
Markdown51260373
JSON500239
HTML2290142
XML21034
YAML28031

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 653)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity39.42
▷ Minimum class complexity1.00
▷ Maximum class complexity766.00
Average method complexity4.65
▷ Minimum method complexity1.00
▷ Maximum method complexity653.00
Code structure
Namespaces24
Interfaces2
Traits0
Classes142
▷ Abstract classes64.23%
▷ Concrete classes13695.77%
▷ Final classes00.00%
Methods1,574
▷ Static methods734.64%
▷ Public methods1,33885.01%
▷ Protected methods17611.18%
▷ Private methods603.81%
Functions18
▷ Named functions738.89%
▷ Anonymous functions1161.11%
Constants150
▷ Global constants32.00%
▷ Class constants14798.00%
▷ Public constants147100.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
2 PNG files occupy 0.19MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshots/Info Message.png193.88KB176.94KB▼ 8.74%
includes/b0c753d17d029f85e573ce22e6b9663b73fd1e35/dompdf/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%