74% test-post-generator

Code Review | Test Post Generator

WordPress plugin Test Post Generator scored74%from 54 tests.

About plugin

  • Plugin page: test-post-generator
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 6.3.1
  • First release: Jul 7, 2020
  • Latest release: Jul 7, 2020
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: plantprogrammer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /559 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.02MB] [CPU: ▼4.68ms] Passed 4 tests

An overview of server-side resources used by Test Post Generator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.23 ▲4.03
Dashboard /wp-admin3.32 ▲0.0244.31 ▼7.54
Posts /wp-admin/edit.php3.37 ▲0.0245.49 ▼0.51
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.73 ▼7.69
Media Library /wp-admin/upload.php3.24 ▲0.0134.83 ▼2.97

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
category_children
can_compress_scripts

Browser metrics Passed 4 tests

Test Post Generator: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7014.80 ▲0.241.64 ▼0.0443.91 ▼1.28
Dashboard /wp-admin2,219 ▲315.80 ▲0.8994.35 ▼8.5640.78 ▼2.17
Posts /wp-admin/edit.php2,120 ▲312.00 ▲0.0039.29 ▲1.6834.55 ▼4.35
Add New Post /wp-admin/post-new.php1,546 ▲3223.19 ▲5.65633.43 ▼54.7355.19 ▲1.35
Media Library /wp-admin/upload.php1,407 ▲164.17 ▼0.0795.06 ▼13.6542.30 ▼3.32

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/test-post-generator/uninstall.php+5
    Constant TEST_POST_SETTING_NAME already defined
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • category_children
    • db_upgraded
    • widget_recent-posts
    • 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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function test_page_generator\\wp_die() in wp-content/plugins/test-post-generator/uninstall.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function test_post_generator\\wp_die() in wp-content/plugins/test-post-generator/test-post-generator.php:39

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: test post generator, test post, test, test posts, testing

test-post-generator/test-post-generator.php 92% from 13 tests

This is the main PHP file of "Test Post Generator" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected148 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP33834148

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.10
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
Namespaces2
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%
Constants5
▷ Global constants5100.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
No PNG images were found in this plugin