10% forms-for-mailograph

Code Review | Forms for Mailograph

WordPress plugin Forms for Mailograph scored10%from 54 tests.

About plugin

  • Plugin page: forms-for-mailograph
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5
  • WordPress version: 6.3.1
  • First release: Jan 9, 2016
  • Latest release: May 25, 2016
  • Number of updates: 10
  • Update frequency: every 13.7 days
  • Top authors: aytech.ca (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /901 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/forms-for-mailograph/subscribe.php+25
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known

Server metrics [RAM: ▼1.96MB] [CPU: ▲168.88ms] Passed 4 tests

A check of server-side resources used by Forms for Mailograph
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.43259.04 ▲220.08
Dashboard /wp-admin2.05 ▼1.26217.33 ▲167.88
Posts /wp-admin/edit.php2.05 ▼1.31228.85 ▲178.63
Add New Post /wp-admin/post-new.php2.05 ▼3.84217.64 ▲125.37
Media Library /wp-admin/upload.php2.05 ▼1.18235.27 ▲203.63

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Forms for Mailograph
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲6114.74 ▲0.361.74 ▲0.0638.15 ▼3.14
Dashboard /wp-admin2,211 ▲295.91 ▲1.0094.65 ▼6.9838.47 ▼1.16
Posts /wp-admin/edit.php2,097 ▲51.97 ▼0.0939.34 ▼5.6140.10 ▲0.32
Add New Post /wp-admin/post-new.php1,419 ▼9521.80 ▲4.25539.22 ▼116.2729.71 ▼14.61
Media Library /wp-admin/upload.php1,393 ▲84.29 ▲0.07100.15 ▼1.5441.62 ▼5.85

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/forms-for-mailograph/subscribe.php+25
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/forms-for-mailograph/subscribe.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/forms-for-mailograph/forms-for-mailograph.php:15
    • > PHP Warning
      file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in wp-content/plugins/forms-for-mailograph/subscribe.php on line 25
    • > PHP Warning
      file_get_contents(http://app.mailograph.com/subscribe): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in wp-content/plugins/forms-for-mailograph/subscribe.php on line 25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === forms-for-mailograph === )
The official readme.txt is a good inspiration

forms-for-mailograph/subscribe.php 92% from 13 tests

This is the main PHP file of "Forms for Mailograph" version 0.2, 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:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("forms-for-mailograph.php" instead of "subscribe.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 detected133 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP21650133

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.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
There were not PNG files found in your plugin