83% send-admin-mail-on-new-post

Code Review | Send admin mail on new post

WordPress plugin Send admin mail on new post scored83%from 54 tests.

About plugin

  • Plugin page: send-admin-mail-o...
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.7.2
  • WordPress version: 6.3.1
  • First release: Oct 19, 2020
  • Latest release: Jul 12, 2021
  • Number of updates: 9
  • Update frequency: every 29.9 days
  • Top authors: jwphpglobe (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /392 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

This is a short check of server-side resources used by Send admin mail on new post
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.80 ▲2.62
Dashboard /wp-admin3.31 ▲0.0148.04 ▼9.14
Posts /wp-admin/edit.php3.36 ▲0.0147.68 ▲1.21
Add New Post /wp-admin/post-new.php5.89 ▲0.0185.61 ▼12.50
Media Library /wp-admin/upload.php3.24 ▲0.0137.73 ▲1.54

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Send admin mail on new post
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲9413.52 ▼0.671.95 ▲0.1143.94 ▼0.22
Dashboard /wp-admin2,224 ▲174.89 ▲0.01101.91 ▼6.8640.59 ▲0.76
Posts /wp-admin/edit.php2,100 ▼02.04 ▲0.0437.73 ▼2.7033.33 ▼2.57
Add New Post /wp-admin/post-new.php1,545 ▲1423.31 ▲0.18680.80 ▲82.5453.54 ▼2.16
Media Library /wp-admin/upload.php1,403 ▲34.22 ▼0.04113.85 ▲6.0647.44 ▲3.59

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/send-admin-mail-on-new-post/send-admin-mail-on-new-post.php:16

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 Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
1 plugin tags: send admin mail on new post

send-admin-mail-on-new-post/send-admin-mail-on-new-post.php 77% from 13 tests

This is the main PHP file of "Send admin mail on new post" version 1.0.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Requires PHP: Required version does not match the one declared in readme.txt ("5.6" instead of "7.0")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Requires at least: Required version does not match the one declared in readme.txt ("5.0" instead of "5.5")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected85 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PO File1161764
PHP161421

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.11MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png27.52KB12.53KB▼ 54.47%
assets/icon-256x256.png80.13KB41.03KB▼ 48.80%