84% content-promoter

Code Review | Content Promoter - Generate leads by promoting content

WordPress plugin Content Promoter - Generate leads by promoting content scored 84% from 54 tests.

About plugin

  • Plugin page: content-promoter
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.1.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.6
  • WordPress version: 6.3.1
  • First release: Jan 28, 2021
  • Latest release: Jan 28, 2021
  • Number of updates: 3
  • Update frequency: every 5.0 days
  • Top authors: feataholic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 412 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▲1.81ms] Passed 4 tests

This is a short check of server-side resources used by Content Promoter - Generate leads by promoting content
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1941.96 ▼5.06
Dashboard /wp-admin3.38 ▲0.0854.50 ▲5.09
Posts /wp-admin/edit.php3.49 ▲0.1455.18 ▲9.15
Add New Post /wp-admin/post-new.php5.97 ▲0.0893.39 ▼1.93
Media Library /wp-admin/upload.php3.30 ▲0.0744.31 ▲10.22
Getting Started /wp-admin/admin.php?page=content-promoter-getting-started3.4862.48
New Item /wp-admin/post-new.php?post_type=content-promoter3.56113.44
Items /wp-admin/edit.php?post_type=content-promoter3.3440.87
Settings /wp-admin/admin.php?page=content-promoter-settings3.3856.97
Dashboard /wp-admin/admin.php?page=content-promoter3.3964.55

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Content Promoter - Generate leads by promoting content
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,899 ▲15313.21 ▼1.141.76 ▼0.0741.98 ▼0.97
Dashboard /wp-admin2,281 ▲965.87 ▲0.03104.47 ▼17.1442.33 ▲0.06
Posts /wp-admin/edit.php2,164 ▲752.00 ▼0.0339.17 ▲1.5334.83 ▲0.98
Add New Post /wp-admin/post-new.php6,471 ▲4,93820.45 ▼3.07934.68 ▲279.7559.75 ▲7.21
Media Library /wp-admin/upload.php1,466 ▲814.22 ▲0.06100.45 ▼1.5942.80 ▼0.90
Getting Started /wp-admin/admin.php?page=content-promoter-getting-started1,6654.9677.55138.72
New Item /wp-admin/post-new.php?post_type=content-promoter2,9135.79108.5353.27
Items /wp-admin/edit.php?post_type=content-promoter1,1331.9330.9929.27
Settings /wp-admin/admin.php?page=content-promoter-settings1,6874.8656.3093.69
Dashboard /wp-admin/admin.php?page=content-promoter1,7934.8780.7779.55

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • ctpr_settings_page_data

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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'ContentPromoter\\Core\\Libs\\Vendors\\AbstractRegistryFormat' not found in wp-content/plugins/content-promoter/Inc/Core/Libs/Vendors/Format/Json.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'ContentPromoter\\Core\\Libs\\Vendors\\AbstractRegistryFormat' not found in wp-content/plugins/content-promoter/Inc/Core/Libs/Vendors/Format/Php.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'ContentPromoter\\Core\\Libs\\Vendors\\AbstractRegistryFormat' not found in wp-content/plugins/content-promoter/Inc/Core/Libs/Vendors/Format/Ini.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: leads, generate leads, conversion, promote content, promotion...

content-promoter/content-promoter.php 85% from 13 tests

The primary PHP file in "Content Promoter - Generate leads by promoting content" version 1.0.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.9.0" instead of "5.4")
  • Requires PHP: Required version does not match the one declared in readme.txt ("7.1" instead of "7.1.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin7,417 lines of code in 140 files:
LanguageFilesBlank linesComment linesLines of code
PHP971,1081,6506,154
JavaScript233231291,219
CSS1716016
XML10014
JSON10013
SVG1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity9.34
▷ Minimum class complexity1.00
▷ Maximum class complexity85.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces11
Interfaces2
Traits0
Classes57
▷ Abstract classes23.51%
▷ Concrete classes5596.49%
▷ Final classes11.82%
Methods212
▷ Static methods4420.75%
▷ Public methods17883.96%
▷ Protected methods94.25%
▷ Private methods2511.79%
Functions26
▷ Named functions27.69%
▷ Anonymous functions2492.31%
Constants23
▷ Global constants1669.57%
▷ Class constants730.43%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 PNG files occupy 0.07MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
media/admin/img/preview/black_friday_sale.png10.33KB5.15KB▼ 50.18%
media/admin/img/welcome/configure.png3.56KB3.62KB0.00%
media/admin/img/preview/cta.png11.70KB5.38KB▼ 54.00%
media/admin/img/welcome/selection.png2.86KB2.86KB0.00%
media/admin/img/welcome/save.png1.06KB1.06KB0.18%