10% easy-announcements

Code Review | Easy Announcements

WordPress plugin Easy Announcements scored10%from 54 tests.

About plugin

  • Plugin page: easy-announcements
  • Plugin version: 0.2.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3.2
  • WordPress version: 6.3.1
  • First release: Jun 18, 2022
  • Latest release: Oct 27, 2023
  • Number of updates: 26
  • Update frequency: every 19.1 days
  • Top authors: phillywebteam (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,148 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/easy-announcements/includes/functions.php+139
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.59MB] [CPU: ▼30.39ms] Passed 4 tests

An overview of server-side resources used by Easy Announcements
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.28 ▲0.8122.30 ▼16.73
Dashboard /wp-admin4.70 ▲1.3927.55 ▼17.54
Posts /wp-admin/edit.php4.70 ▲1.3425.97 ▼21.92
Add New Post /wp-admin/post-new.php4.70 ▼1.1927.48 ▼65.35
Media Library /wp-admin/upload.php4.70 ▲1.4725.26 ▼5.36
Field Groups /wp-admin/edit.php?post_type=acf-field-group4.7027.28
Post Types /wp-admin/edit.php?post_type=acf-post-type4.7024.11
All announcements /wp-admin/edit.php?post_type=announcement4.7024.23
Taxonomies /wp-admin/edit.php?post_type=acf-taxonomy4.7026.34
Settings /wp-admin/edit.php?post_type=announcement&page=easy-announcements-admin4.7025.32
Add New /wp-admin/post-new.php?post_type=announcement4.7024.31

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 473 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
acf_version
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Easy Announcements
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,928 ▲16713.66 ▼1.1011.35 ▲9.8142.57 ▲2.68
Dashboard /wp-admin2,241 ▲705.51 ▼0.0881.27 ▼9.9638.29 ▲0.06
Posts /wp-admin/edit.php2,149 ▲492.02 ▲0.0636.21 ▲0.2937.48 ▲2.93
Add New Post /wp-admin/post-new.php6,721 ▲5,19524.41 ▲0.74990.37 ▲372.5053.24 ▲4.45
Media Library /wp-admin/upload.php2,001 ▲6078.24 ▲3.97218.83 ▲122.1852.38 ▲9.51
Field Groups /wp-admin/edit.php?post_type=acf-field-group1,7202.4040.2370.24
Post Types /wp-admin/edit.php?post_type=acf-post-type1,7532.3837.2442.07
All announcements /wp-admin/edit.php?post_type=announcement1,1332.2234.0229.81
Taxonomies /wp-admin/edit.php?post_type=acf-taxonomy1,7812.1434.7242.58
Settings /wp-admin/edit.php?post_type=announcement&page=easy-announcements-admin2,2882.8093.5033.10
Add New /wp-admin/post-new.php?post_type=announcement7,62627.11974.0557.73

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
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/easy-announcements/includes/functions.php+139
    Trying to access array offset on value of type bool
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • acf_version
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 114 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=announcement
    • > Notice in wp-content/plugins/easy-announcements/includes/functions.php+139
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/post-new.php?post_type=announcement
    • > User deprecated in wp-includes/functions.php+5828
    Hook allowed_block_types is deprecated since version 5.8.0! Use allowed_block_types_all instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 104× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-announcements/includes/acf/includes/upgrades.php:456
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/easy-announcements/includes/acf/includes/fields/class-acf-field-color_picker.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-announcements/includes/acf/includes/acf-bidirectional-functions.php:202
    • > PHP Notice
      Undefined variable: rule in wp-content/plugins/easy-announcements/includes/acf/includes/admin/views/acf-field-group/location-rule.php on line 4
    • > PHP Warning
      include(): Failed opening 'EASY_ANNOUNCEMENTS_ABSPATH/admin/admin-functions.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/easy-announcements/admin/admin.php on line 2
    • > PHP Warning
      Use of undefined constant EASY_ANNOUNCEMENTS_ABSPATH - assumed 'EASY_ANNOUNCEMENTS_ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/easy-announcements/admin/admin.php on line 3
    • > PHP Warning
      Use of undefined constant EASY_ANNOUNCEMENTS_ABSPATH - assumed 'EASY_ANNOUNCEMENTS_ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/easy-announcements/admin/admin.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-announcements/includes/acf/includes/forms/form-attachment.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/easy-announcements/includes/acf/includes/admin/views/acf-field-group/pro-features.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function acf_register_store() in wp-content/plugins/easy-announcements/includes/acf/includes/acf-value-functions.php:4

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
  • Contributors: Plugin contributors field is missing
  • Screenshots: These screenshots need descriptions #1, #2, #3, #4 in easy-announcements/assets to your readme.txt
The official readme.txt is a good inspiration

easy-announcements/easy-announcements.php 92% from 13 tests

"Easy Announcements" version 0.2.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

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
There were no executable files found in this plugin193,192 lines of code in 359 files:
LanguageFilesBlank linesComment linesLines of code
PO File4646,76770,992112,491
JavaScript265,3437,48339,651
PHP1749,44921,07727,612
CSS177151,52913,138
SVG9500291
Markdown1509

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity18.69
▷ Minimum class complexity1.00
▷ Maximum class complexity110.00
Average method complexity3.08
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes115
▷ Abstract classes32.61%
▷ Concrete classes11297.39%
▷ Final classes21.79%
Methods968
▷ Static methods20.21%
▷ Public methods94497.52%
▷ Protected methods00.00%
▷ Private methods242.48%
Functions578
▷ Named functions56898.27%
▷ Anonymous functions101.73%
Constants17
▷ Global constants1588.24%
▷ Class constants211.76%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
43 PNG files occupy 0.86MB with 0.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/acf/assets/images/field-type-previews/field-preview-radio-button.png15.22KB6.14KB▼ 59.69%
includes/acf/assets/images/field-type-previews/field-preview-google-map.png9.28KB3.62KB▼ 60.98%
includes/acf/assets/inc/datepicker/images/ui-icons_DDDDDD_256x240.png3.68KB4.17KB0.00%
includes/acf/assets/images/field-type-previews/field-preview-taxonomy.png11.45KB6.06KB▼ 47.07%
includes/acf/assets/inc/select2/3/select2.png0.51KB0.99KB0.00%