78% csh-testimonials

Code Review | Csh Testimonials

WordPress plugin Csh Testimonials scored78%from 54 tests.

About plugin

  • Plugin page: csh-testimonials
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.4
  • WordPress version: 6.3.1
  • First release: Dec 28, 2017
  • Latest release: Mar 27, 2018
  • Number of updates: 4
  • Update frequency: every 23.0 days
  • Top authors: cmssuperheroes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /623 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼3.28ms] Passed 4 tests

A check of server-side resources used by Csh Testimonials
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1043.94 ▼2.75
Dashboard /wp-admin3.37 ▲0.0644.95 ▼1.85
Posts /wp-admin/edit.php3.42 ▲0.0651.47 ▲2.88
Add New Post /wp-admin/post-new.php5.97 ▲0.0887.40 ▼11.38
Media Library /wp-admin/upload.php3.29 ▲0.0644.01 ▲11.42
Manual Shortcode /wp-admin/edit.php?post_type=csh_testimonial&page=csh-testimonials-setting3.2835.15
Categories /wp-admin/edit-tags.php?taxonomy=cshtm_cat&post_type=csh_testimonial3.3735.32
Add New /wp-admin/post-new.php?post_type=csh_testimonial3.4450.94
All Testimonials /wp-admin/edit.php?post_type=csh_testimonial3.3336.89

Server storage [IO: ▲0.10MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Csh Testimonials
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,181 ▲43515.53 ▲1.1727.99 ▲25.4939.70 ▼3.89
Dashboard /wp-admin2,245 ▲575.87 ▼0.03102.27 ▲2.9937.17 ▼7.48
Posts /wp-admin/edit.php2,128 ▲392.03 ▼0.0339.32 ▼3.4634.86 ▼2.66
Add New Post /wp-admin/post-new.php1,556 ▲2019.47 ▼3.96598.91 ▼9.2333.35 ▼26.03
Media Library /wp-admin/upload.php1,418 ▲334.17 ▼0.0390.84 ▼6.8241.96 ▼0.19
Manual Shortcode /wp-admin/edit.php?post_type=csh_testimonial&page=csh-testimonials-setting1,1533.3842.0232.67
Categories /wp-admin/edit-tags.php?taxonomy=cshtm_cat&post_type=csh_testimonial1,3012.1535.9141.29
Add New /wp-admin/post-new.php?post_type=csh_testimonial2,3477.61182.8071.87
All Testimonials /wp-admin/edit.php?post_type=csh_testimonial1,1131.9929.8327.13

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Please fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/csh-testimonials/layouts/layout2/layout2.php
    • > /wp-content/plugins/csh-testimonials/layouts/layout1/layout1.php
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined variable: l1_index in wp-content/plugins/csh-testimonials/layouts/layout1/layout1.php on line 4
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/csh-testimonials/layouts/layout2/layout2.php on line 8
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/csh-testimonials/layouts/layout1/layout1.php on line 8
    • > PHP Notice
      Undefined variable: all_posts in wp-content/plugins/csh-testimonials/layouts/layout1/layout1.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/csh-testimonials/includes/class-csh-testimonials.php:81
    • > PHP Notice
      Undefined variable: all_posts in wp-content/plugins/csh-testimonials/layouts/layout2/layout2.php on line 8
    • > PHP Notice
      Undefined variable: l2_index in wp-content/plugins/csh-testimonials/layouts/layout2/layout2.php on line 4

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention: You can take inspiration from this readme.txt

csh-testimonials/csh-testimonials.php 92% from 13 tests

"Csh Testimonials" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected966 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP8168186590
CSS4565292
JavaScript26784

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity11.67
▷ Minimum class complexity2.00
▷ Maximum class complexity22.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods31
▷ Static methods00.00%
▷ Public methods3096.77%
▷ Protected methods00.00%
▷ Private methods13.23%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/vc_icon.png16.78KB1.66KB▼ 90.10%
assets/images/bar-button.png2.05KB1.26KB▼ 38.51%