84% scheduled-announcements-widget

Code Review | Scheduled Announcements Widget

WordPress plugin Scheduled Announcements Widget scored84%from 54 tests.

About plugin

  • Plugin page: scheduled-announc...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.1-6.1
  • WordPress version: 6.3.1
  • First release: Feb 2, 2012
  • Latest release: Mar 10, 2023
  • Number of updates: 14
  • Update frequency: every 289.6 days
  • Top authors: kionae (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /15,727 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.76ms] Passed 4 tests

This is a short check of server-side resources used by Scheduled Announcements Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0635.00 ▼7.79
Dashboard /wp-admin3.35 ▲0.0546.66 ▼1.91
Posts /wp-admin/edit.php3.40 ▲0.0544.99 ▲0.42
Add New Post /wp-admin/post-new.php5.94 ▲0.0595.46 ▼8.96
Media Library /wp-admin/upload.php3.28 ▲0.0536.12 ▼0.37
Announcement Categories /wp-admin/edit-tags.php?taxonomy=saw_categories&post_type=sched_announcement3.2733.27
Settings /wp-admin/edit.php?post_type=sched_announcement&page=scheduled-announcement-widget3.2528.78
Add Announcement /wp-admin/post-new.php?post_type=sched_announcement3.4244.05
Announcements /wp-admin/edit.php?post_type=sched_announcement3.3235.88

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 15 new options
New WordPress options
widget_recent-posts
saw_height_options
can_compress_scripts
saw_speed_options
widget_saw_widget
saw_text_color_options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
saw_order_options
...

Browser metrics Passed 4 tests

An overview of browser requirements for Scheduled Announcements Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,954 ▲18313.74 ▼0.895.29 ▲3.4038.94 ▼4.13
Dashboard /wp-admin2,256 ▲655.05 ▲0.12100.88 ▼5.5762.11 ▲22.60
Posts /wp-admin/edit.php2,133 ▲442.10 ▲0.1335.30 ▼5.5432.85 ▼5.85
Add New Post /wp-admin/post-new.php1,568 ▲4023.22 ▲5.00696.78 ▲79.0051.60 ▼5.19
Media Library /wp-admin/upload.php1,435 ▲474.29 ▲0.04104.61 ▼2.8968.68 ▲26.73
Announcement Categories /wp-admin/edit-tags.php?taxonomy=saw_categories&post_type=sched_announcement1,3092.2930.9030.51
Settings /wp-admin/edit.php?post_type=sched_announcement&page=scheduled-announcement-widget1,0221.8428.7027.53
Add Announcement /wp-admin/post-new.php?post_type=sched_announcement2,3827.70173.99128.14
Announcements /wp-admin/edit.php?post_type=sched_announcement1,1002.0635.1027.97

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options were found after uninstall: 15 options
    • saw_link_color_options
    • widget_recent-posts
    • widget_saw_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • saw_speed_options
    • saw_scroll_options
    • widget_theysaidso_widget
    • saw_trans_options
    • saw_order_options
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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 fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/scheduled-announcements-widget/scheduled-announcements.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (The widget works in both the sidebar and within posts/pages and themes.), #2 (Customize the widget under Announcements > Settings), #3 (Announcements can appear on the site indefinitely or only during a set time range.)
The official readme.txt is a good inspiration

scheduled-announcements-widget/scheduled-announcements.php 92% from 13 tests

"Scheduled Announcements Widget" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("scheduled-announcements-widget.php" instead of "scheduled-announcements.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
Success! There were no dangerous files found in this plugin1,346 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript113336766
PHP110456580

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/jscolor/hs.png2.62KB7.54KB0.00%
js/jscolor/hv.png2.80KB7.32KB0.00%
saw-menu-icon.png1.27KB0.63KB▼ 50.58%