10% announcements

Code Review | Announcements

WordPress plugin Announcements scored10%from 54 tests.

About plugin

  • Plugin page: announcements
  • Plugin version: 1.9.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-6.0
  • WordPress version: 6.3.1
  • First release: Dec 7, 2016
  • Latest release: Jun 23, 2022
  • Number of updates: 9
  • Update frequency: every 223.9 days
  • Top authors: zhuyi (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /4,583 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > User deprecated in wp-includes/functions.php+5643
    File upgrade-functions.php is deprecated since version 2.5.0! Use wp-admin/includes/upgrade.php instead.

Server metrics [RAM: ▼0.93MB] [CPU: ▼29.28ms] Passed 4 tests

A check of server-side resources used by Announcements
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0232.35 ▼6.23
Dashboard /wp-admin3.01 ▼0.2925.49 ▼21.84
Posts /wp-admin/edit.php3.01 ▼0.3525.30 ▼20.54
Add New Post /wp-admin/post-new.php3.01 ▼2.8831.24 ▼63.60
Media Library /wp-admin/upload.php3.01 ▼0.2223.22 ▼11.15
Site Frontend Announcements /wp-admin/admin.php?page=Announcements-Site-Frontend3.0122.48
Announcement Settings /wp-admin/admin.php?page=Announcement-Settings3.0119.60
Announcements /wp-admin/admin.php?page=Announcements3.0122.53

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 11 new files
Database: 2 new tables, 7 new options
New tables
wp_announceuser
wp_announcement
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
announcementInstalled
db_upgraded

Browser metrics Passed 4 tests

Announcements: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲16613.63 ▼0.684.73 ▲3.0739.67 ▼1.39
Dashboard /wp-admin2,240 ▲556.09 ▲0.2394.50 ▼8.0039.38 ▼7.16
Posts /wp-admin/edit.php2,120 ▲282.05 ▲0.0042.02 ▼0.8234.94 ▼0.26
Add New Post /wp-admin/post-new.php1,567 ▲3918.69 ▲0.56621.73 ▲3.3652.07 ▼7.47
Media Library /wp-admin/upload.php1,419 ▲314.19 ▼0.0693.97 ▼4.6941.80 ▼4.17
Site Frontend Announcements /wp-admin/admin.php?page=Announcements-Site-Frontend8762.0223.9226.35
Announcement Settings /wp-admin/admin.php?page=Announcement-Settings9032.0423.1421.71
Announcements /wp-admin/admin.php?page=Announcements7932.1824.5424.01

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_announceuser
    • wp_announcement
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • announcementInstalled
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 27 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Announcements
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Announcements
    • > User deprecated in wp-includes/functions.php+5453
    Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead.
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Announcements
    • > User deprecated in wp-includes/functions.php+5737
    Function WP_User->id was called with an argument that is deprecated since version 2.1.0! Use WP_User->ID instead.

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: Too many tags (27 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

announcements/announcement.php 85% from 13 tests

"Announcements" version 1.9.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("announcements.php" instead of "announcement.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin839 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP711762726
JavaScript12314113

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
asset/images/new.png3.48KB1.90KB▼ 45.54%