10% wp-announce

Code Review | WP Announce

WordPress plugin WP Announce scored10%from 54 tests.

About plugin

  • Plugin page: wp-announce
  • Plugin version: 3.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9.1
  • WordPress version: 6.3.1
  • First release: Feb 19, 2014
  • Latest release: Jun 13, 2014
  • Number of updates: 32
  • Update frequency: every 3.6 days
  • Top authors: rockaja (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

10+ active /7,184 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/wp-announce/src/wp-announce.php+676
    Undefined index: post_type

Server metrics [RAM: ▼1.74MB] [CPU: ▼50.62ms] 75% from 4 tests

An overview of server-side resources used by WP Announce
The following require your attention
  • CPU: Total CPU usage must kept under 500.00ms (currently 733.93ms on /wp-admin/post-new.php?post_type=announce)
PageMemory (MB)CPU Time (ms)
Home /2.25 ▼1.225.83 ▼34.03
Dashboard /wp-admin2.27 ▼1.045.87 ▼48.74
Posts /wp-admin/edit.php2.27 ▼1.096.38 ▼39.43
Add New Post /wp-admin/post-new.php2.27 ▼3.627.38 ▼80.26
Media Library /wp-admin/upload.php2.27 ▼0.966.13 ▼27.25
Add Announcement /wp-admin/post-new.php?post_type=announce3.46733.93
Announcements /wp-admin/edit.php?post_type=announce3.4341.64

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
wpa_post_id
widget_recent-posts
can_compress_scripts
db_upgraded
wpa_options
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

WP Announce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,631 ▲88514.32 ▼0.2611.78 ▲10.0447.63 ▲4.27
Dashboard /wp-admin2,240 ▲555.87 ▲1.0296.76 ▼19.4257.71 ▲13.50
Posts /wp-admin/edit.php2,123 ▲372.06 ▲0.0536.74 ▼0.1631.67 ▼2.54
Add New Post /wp-admin/post-new.php1,695 ▲17522.24 ▼1.00745.14 ▲67.8075.63 ▲23.58
Media Library /wp-admin/upload.php1,422 ▲344.15 ▼0.08116.99 ▲17.7451.06 ▲6.91
Add Announcement /wp-admin/post-new.php?post_type=announce2,4927.70190.05161.33
Announcements /wp-admin/edit.php?post_type=announce1,6682.0134.3732.13

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
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/wp-announce/src/wp-announce.php+676
    Undefined index: post_type
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • wpa_post_id
    • wpa_options
    • widget_theysaidso_widget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/edit.php?post_type=announce
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/wp-announce/src/wp-announce.php+676
    Undefined index: post_type

SRP 0% 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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-announce/wp-announce.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined index: wpa_post_id in wp-content/plugins/wp-announce/src/js/wp-announce-ajax.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post() in wp-content/plugins/wp-announce/src/js/wp-announce-ajax.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post() in wp-content/plugins/wp-announce/src/tpl/wpa_template.php:10
    • > PHP Notice
      Undefined index: p in wp-content/plugins/wp-announce/src/tpl/wpa_template.php on line 8

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/post-new.php?post_type=announce
    • > Network (severe)
    tj.js - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=announce
    • > Network (severe)
    common.js - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 75% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Plugin Name: Please specify the plugin name on the first line ( === wp-announce === )
  • Screenshots: A description for screenshot #2 is required in wp-announce/assets to your readme.txt
  • Screenshots: Please add an image for screenshot #3 (Announcement admin area.)
  • Tags: There are too many tags (22 tag instead of maximum 10)
The official readme.txt is a good inspiration

wp-announce/wp-announce.php 92% from 13 tests

"WP Announce" version 3.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 343 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin754 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP421171688
CSS113966

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
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%
Functions24
▷ Named functions2395.83%
▷ Anonymous functions14.17%
Constants5
▷ Global constants5100.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/css/images/announce-icon.png1.20KB0.34KB▼ 71.93%
src/css/images/wpa-close.png2.21KB1.26KB▼ 42.91%
src/images/announce-icon.png1.20KB0.34KB▼ 71.93%