84% contrast-content-generator

Code Review | Contrast Digital - Content Generator

WordPress plugin Contrast Digital - Content Generator scored84%from 54 tests.

About plugin

  • Plugin page: contrast-content-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.6
  • WordPress version: 6.3.1
  • First release: Aug 30, 2016
  • Latest release: Aug 26, 2016
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: contrastdigital (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /762 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
This plugin's installer ran successfully

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

An overview of server-side resources used by Contrast Digital - Content Generator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0246.59 ▲4.66
Dashboard /wp-admin3.33 ▼0.0254.85 ▼7.08
Posts /wp-admin/edit.php3.38 ▲0.0246.10 ▼2.79
Add New Post /wp-admin/post-new.php5.91 ▲0.0284.13 ▼19.55
Media Library /wp-admin/upload.php3.26 ▲0.0231.79 ▼0.86
Generate content /wp-admin/tools.php?page=content-generator3.2231.46

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Contrast Digital - Content Generator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.26 ▼0.091.79 ▼0.2244.03 ▲0.78
Dashboard /wp-admin2,199 ▲195.62 ▲0.0887.06 ▼1.7941.95 ▲1.53
Posts /wp-admin/edit.php2,101 ▲11.97 ▲0.0134.46 ▼4.0336.01 ▼0.57
Add New Post /wp-admin/post-new.php1,531 ▼423.39 ▲5.23682.40 ▲35.9455.48 ▼17.62
Media Library /wp-admin/upload.php1,407 ▲104.20 ▲0.0496.65 ▼6.6542.67 ▼1.67
Generate content /wp-admin/tools.php?page=content-generator8132.0224.2825.16

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

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 no errors were found, this is by no means 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
Almost there! Just fix the following items
  • 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/contrast-content-generator/includes/cntrst-generate-plugin-settings.php:15

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
2 plugin tags: content generator, lorem ipsum

contrast-content-generator/cntrst-content-generator.php 85% from 13 tests

The principal PHP file in "Contrast Digital - Content Generator" v. 1.0.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("contrast-content-generator.php" instead of "cntrst-content-generator.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 plugin128 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2345793
PO File181135

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity3.50
▷ Minimum class complexity3.00
▷ Maximum class complexity4.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin