73% cptrp

Code Review | CPTRP

WordPress plugin CPTRP scored73%from 54 tests.

About plugin

  • Plugin page: cptrp
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.5
  • WordPress version: 6.3.1
  • First release: May 10, 2016
  • Latest release: May 3, 2016
  • Number of updates: 5
  • Update frequency: every 0.8 days
  • Top authors: dvddemattia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /574 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.58MB] [CPU: ▼16.04ms] Passed 4 tests

An overview of server-side resources used by CPTRP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1040.17 ▼1.82
Dashboard /wp-admin3.42 ▲0.1148.50 ▼1.13
Posts /wp-admin/edit.php3.53 ▲0.1747.30 ▲2.94
Add New Post /wp-admin/post-new.php3.27 ▼2.6235.42 ▼60.82
Media Library /wp-admin/upload.php3.34 ▲0.1135.67 ▼0.40
CPTRP /wp-admin/options-general.php?page=cptrp3.3030.64

Server storage [IO: ▲0.06MB] [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: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for CPTRP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6213.17 ▼1.201.81 ▼0.3542.57 ▼0.34
Dashboard /wp-admin2,214 ▲234.83 ▼0.08112.64 ▲8.5242.95 ▲1.36
Posts /wp-admin/edit.php2,079 ▼102.04 ▲0.0734.33 ▼4.2632.80 ▼1.61
Add New Post /wp-admin/post-new.php1,521 ▲123.08 ▼0.37692.40 ▼12.9356.69 ▼11.32
Media Library /wp-admin/upload.php1,396 ▲84.27 ▲0.0097.19 ▼15.0840.97 ▼2.24
CPTRP /wp-admin/options-general.php?page=cptrp6971.536.3924.58

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=cptrp
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/cptrp/admin/templates/settings.php on line 8 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/cptrp/admin/templates/settings.php(8): do_settings_fields()
    #1 wp-content/plugins/cptrp/admin/settings.php(287): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): cptrp_settings->cptrp_plugin_settings_page()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/cptrp/public/partials/cptrp-public-display.php
    • > /wp-content/plugins/cptrp/admin/partials/cptrp-admin-display.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cptrp/admin/templates/settings.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: related post, custom post type, post

cptrp/cptrp.php Passed 13 tests

The primary PHP file in "CPTRP" version 1.0.0 is used by WordPress to initiate all plugin functionality
41 characters long description:
Adding related posts to custom post type.

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 plugin587 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP14312599511
PO File1141450
CSS25820
JavaScript24546

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity5.25
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity1.85
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods40
▷ Static methods25.00%
▷ Public methods3587.50%
▷ Protected methods00.00%
▷ Private methods512.50%
Functions4
▷ Named functions4100.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
PNG images were not found in this plugin