67% admin-user-messages

Code Review | Admin User Messages

WordPress plugin Admin User Messages scored 67% from 54 tests.

About plugin

  • Plugin page: admin-user-messages
  • Plugin version: 0.1.6
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • 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

30+ active / 5,192 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼305.23ms] Passed 4 tests

A check of server-side resources used by Admin User Messages
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0154.35 ▲4.89
Dashboard /wp-admin3.42 ▲0.0132.40 ▲1.30
Posts /wp-admin/edit.php3.65 ▲0.0136.34 ▲0.53
Add New Post /wp-admin/post-new.php6.89 ▼0.0890.46 ▼1,222.86
Media Library /wp-admin/upload.php3.30 ▲0.0124.90 ▲0.13
Admin User Messages /wp-admin/options-general.php?page=testsettings3.3222.06

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 14 new files
Database: 2 new tables, 1 new option
New tables
wp_admin_user_message
wp_admin_user_message_settings
New WordPress options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

A check of browser resources used by Admin User Messages
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,774 ▲2015.85 ▲0.196.55 ▲0.202.05 ▼0.52
Dashboard /wp-admin2,899 ▲416.14 ▼0.07118.39 ▼14.61156.33 ▼2.80
Posts /wp-admin/edit.php2,698 ▲43.22 ▼0.0261.50 ▲0.93140.09 ▼3.36
Add New Post /wp-admin/post-new.php1,703 ▲4822.09 ▲1.90395.75 ▼21.41151.60 ▼4.51
Media Library /wp-admin/upload.php1,705 ▲75.49 ▲0.00152.62 ▲11.46190.07 ▲5.15
Admin User Messages /wp-admin/options-general.php?page=testsettings8361.9736.4871.29

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
The following items require your attention
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_admin_user_message
    • wp_admin_user_message_settings
  • The uninstall procedure has failed, leaving 1 option in the database
    • recovery_mode_email_last_sent

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > 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(307): admin_user_msg2()
    #2 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(474): 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 | 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 fix the following items
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > 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 add_shortcode() in wp-content/plugins/admin-user-messages/admin_user_messages_write_message.php:271
    • > 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_inbox.php:262
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/admin-user-messages/admin_user_messages.php:14
    • > 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_sent_messages.php:249

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • 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: Invalid version format
Please take inspiration from this readme.txt

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

The main PHP file in "Admin User Messages" ver. 0.1.6 adds more information about the plugin and also serves as the entry point for this plugin
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
Success! There were no dangerous files found in this plugin1,357 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP9651701,341
CSS13016

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues 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

Using a strong compression for your PNG files is a great way to speed-up your plugin
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-2.png269.94KB116.76KB▼ 56.75%
screenshot-1.png222.77KB74.13KB▼ 66.72%