67% admin-user-messages

Code Review | Admin User Messages

WordPress plugin Admin User Messages scored67%from 54 tests.

About plugin

  • Plugin page: admin-user-messages
  • Plugin version: 0.1.6
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 19, 2014
  • Latest release: Aug 11, 2014
  • Number of updates: 35
  • Update frequency: every 4.1 days
  • Top authors: Zaunkoenig (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

20+ active /5,550 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.16MB] [CPU: ▼6.21ms] Passed 4 tests

A check of server-side resources used by Admin User Messages
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1642.47 ▲5.10
Dashboard /wp-admin3.47 ▲0.1645.00 ▼7.84
Posts /wp-admin/edit.php3.52 ▲0.1648.69 ▲2.39
Add New Post /wp-admin/post-new.php6.05 ▲0.1681.11 ▼19.06
Media Library /wp-admin/upload.php3.39 ▲0.1633.06 ▼0.34
Admin User Messages /wp-admin/options-general.php?page=testsettings3.3731.84

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 14 new files
Database: 2 new tables, 7 new options
New tables
wp_admin_user_message_settings
wp_admin_user_message
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
recovery_mode_email_last_sent
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Admin User Messages
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6413.24 ▼1.354.67 ▲2.9046.63 ▲6.13
Dashboard /wp-admin2,215 ▲305.84 ▲0.02110.41 ▼4.7236.59 ▼9.60
Posts /wp-admin/edit.php2,095 ▲62.03 ▲0.0239.22 ▲0.2534.12 ▼2.94
Add New Post /wp-admin/post-new.php1,535 ▲1623.36 ▲0.19653.64 ▼24.9645.24 ▼6.66
Media Library /wp-admin/upload.php1,397 ▲94.20 ▲0.0193.70 ▼14.6242.65 ▼3.00
Admin User Messages /wp-admin/options-general.php?page=testsettings6801.146.4615.49

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
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_admin_user_message_settings
    • wp_admin_user_message
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

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
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=testsettings
    • > Error in wp-content/plugins/admin-user-messages/admin_user_messages_settings.php+10
    Uncaught Error: Call to undefined function mysql_query() in wp-content/plugins/admin-user-messages/admin_user_messages_settings.php:10
    Stack trace:
    #0 wp-content/plugins/admin-user-messages/admin_user_messages_functions.php(245): include()
    #1 wp-includes/class-wp-hook.php(310): admin_user_msg2()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #6 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/admin-user-messages/admin_user_messages_inbox.php:262
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/admin-user-messages/admin_user_messages_search.php:112
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/admin-user-messages/admin_user_messages_answer_message.php:261
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/admin-user-messages/admin_user_messages_sent_messages.php:249
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/admin-user-messages/admin_user_messages_read_message.php:151
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mysql_query() in wp-content/plugins/admin-user-messages/admin_user_messages_settings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/admin-user-messages/admin_user_messages_write_message.php:271
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/admin-user-messages/admin_user_messages_settings.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/admin-user-messages/admin_user_messages.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Translate the plugin into your language), #2 (Write E-Mails to your users.), #3 (Receive E-Mails from your users)
  • Requires at least: Version format is invalid
The official readme.txt is a good inspiration

admin-user-messages/admin_user_messages.php 92% from 13 tests

The main PHP script in "Admin User Messages" version 0.1.6 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("admin-user-messages.php" instead of "admin_user_messages.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
No dangerous file extensions were detected1,357 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP9651701,341
CSS13016

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.83MB with 0.50MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png352.90KB152.30KB▼ 56.84%
screenshot-1.png222.77KB74.13KB▼ 66.72%
screenshot-2.png269.94KB116.76KB▼ 56.75%