84% p2-by-email

Code Review | P2 By Email

WordPress plugin P2 By Email scored84%from 54 tests.

About plugin

  • Plugin page: p2-by-email
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4+
  • WordPress version: 6.3.1
  • First release: May 8, 2013
  • Latest release: May 9, 2013
  • Number of updates: 6
  • Update frequency: every 1.3 days
  • Top authors: danielbachhuber (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30+ active /3,809 total downloads

Benchmarks

Plugin footprint 83% 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.02MB] [CPU: ▼4.19ms] Passed 4 tests

An overview of server-side resources used by P2 By Email
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.48 ▼2.81
Dashboard /wp-admin3.33 ▲0.0251.83 ▼4.26
Posts /wp-admin/edit.php3.44 ▲0.0849.15 ▲3.72
Add New Post /wp-admin/post-new.php5.91 ▲0.0283.71 ▼9.22
Media Library /wp-admin/upload.php3.25 ▲0.0237.42 ▼0.47

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for P2 By Email
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲5413.74 ▼0.631.74 ▼0.5141.76 ▼4.71
Dashboard /wp-admin2,206 ▲155.91 ▲0.03113.13 ▼0.4244.46 ▼2.23
Posts /wp-admin/edit.php2,092 ▲32.05 ▲0.0439.40 ▲2.2633.15 ▼4.15
Add New Post /wp-admin/post-new.php1,542 ▲2318.47 ▼4.57617.08 ▲11.1655.92 ▼4.89
Media Library /wp-admin/upload.php1,391 ▲34.19 ▼0.0698.34 ▼8.3041.93 ▼2.98

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 13× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'P2_By_Email' not found in wp-content/plugins/p2-by-email/inc/class-p2be-emails.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/p2-by-email/tests/test-sample.php:3
    • > PHP Notice
      Undefined variable: author_wrote in wp-content/plugins/p2-by-email/templates/post.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_content() in wp-content/plugins/p2-by-email/templates/post.php:3
    • > PHP Notice
      Undefined variable: quoted_text in wp-content/plugins/p2-by-email/templates/comment.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'P2_By_Email' not found in wp-content/plugins/p2-by-email/inc/class-p2be-email-replies.php:3
    • > PHP Fatal error
      require_once(): Failed opening required '/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/p2-by-email/tests/bootstrap.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/p2-by-email/inc/class-p2be-wp-cli.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function comment_text() in wp-content/plugins/p2-by-email/templates/comment.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/p2-by-email/p2-by-email.php:120

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Tested up to: Version not formatted correctly
The official readme.txt is a good inspiration

p2-by-email/p2-by-email.php 92% from 13 tests

The entry point to "P2 By Email" version 1.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin758 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP10219166744
XML10014

PHP code Passed 2 tests

A brief analysis 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.32
Average class complexity15.14
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.90
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods52
▷ Static methods11.92%
▷ Public methods2955.77%
▷ Protected methods59.62%
▷ Private methods1834.62%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin