72% advanced-wp-testimonial

Code Review | Advanced WP Testimonial

WordPress plugin Advanced WP Testimonial scored72%from 54 tests.

About plugin

  • Plugin page: advanced-wp-testi...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.4.2
  • WordPress version: 6.3.1
  • First release: Dec 9, 2012
  • Latest release: Dec 9, 2012
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: anthakkar08 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,615 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.24MB] [CPU: ▼23.35ms] Passed 4 tests

Analyzing server-side resources used by Advanced WP Testimonial
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.94 ▼0.5218.53 ▼23.68
Dashboard /wp-admin3.26 ▼0.0930.63 ▼33.92
Posts /wp-admin/edit.php3.36 ▲0.0036.43 ▼7.81
Add New Post /wp-admin/post-new.php5.55 ▼0.3473.34 ▼27.89
Media Library /wp-admin/upload.php3.29 ▲0.0629.86 ▼7.90
Add Testimonials /wp-admin/post-new.php?post_type=awt_testimonial3.2433.02
Testimonials /wp-admin/edit.php?post_type=awt_testimonial3.3936.56
Settings /wp-admin/edit.php?post_type=awt_testimonial&page=awt_settings3.3131.00

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_awt_testimonial_widget
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Advanced WP Testimonial: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲8813.26 ▼1.341.66 ▼0.1539.70 ▼3.09
Dashboard /wp-admin2,237 ▲464.82 ▼0.99105.44 ▼9.4841.47 ▼6.02
Posts /wp-admin/edit.php2,120 ▲342.05 ▲0.0639.76 ▲3.2334.19 ▲1.78
Add New Post /wp-admin/post-new.php1,540 ▲717.60 ▼3.42642.84 ▼140.8754.17 ▼24.23
Media Library /wp-admin/upload.php1,419 ▲344.24 ▲0.14104.57 ▼6.9145.30 ▼3.77
Add Testimonials /wp-admin/post-new.php?post_type=awt_testimonial2,3077.71174.8467.95
Testimonials /wp-admin/edit.php?post_type=awt_testimonial1,0862.0431.9529.61
Settings /wp-admin/edit.php?post_type=awt_testimonial&page=awt_settings9972.0827.5942.55

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_awt_testimonial_widget
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/post-new.php?post_type=awt_testimonial
    • > Notice in wp-content/plugins/advanced-wp-testimonial/init.php+89
    Undefined index: awt_client_name
    • > GET request to /wp-admin/post-new.php?post_type=awt_testimonial
    • > Notice in wp-content/plugins/advanced-wp-testimonial/init.php+90
    Undefined index: awt_client_siteurl
    • > GET request to /wp-admin/post-new.php?post_type=awt_testimonial
    • > Notice in wp-content/plugins/advanced-wp-testimonial/html/client_meta_box.php+4
    Undefined index: post

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/advanced-wp-testimonial/template/widget-awt_testimonial.php
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/advanced-wp-testimonial/template/single-awt_testimonial.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/advanced-wp-testimonial/widgets/testimonial_widget.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/advanced-wp-testimonial/widgets/testimonial_widget.php:3
    • > PHP Notice
      Trying to get property 'before_widget' of non-object in wp-content/plugins/advanced-wp-testimonial/template/widget-awt_testimonial.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/advanced-wp-testimonial/template/archive-awt_testimonial.php:2
    • > PHP Notice
      Trying to get property 'posts' of non-object in wp-content/plugins/advanced-wp-testimonial/template/widget-awt_testimonial.php on line 18
    • > PHP Notice
      Trying to get property 'after_widget' of non-object in wp-content/plugins/advanced-wp-testimonial/template/widget-awt_testimonial.php on line 53
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/advanced-wp-testimonial/template/widget-awt_testimonial.php on line 18

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 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (General Settings Screen For the Plugin Options), #2 (list of All the Testimonials), #3 (Add New Testimonial)
Please take inspiration from this readme.txt

advanced-wp-testimonial/init.php 92% from 13 tests

This is the main PHP file of "Advanced WP Testimonial" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("advanced-wp-testimonial.php" instead of "init.php")

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
Everything looks great! No dangerous files found in this plugin721 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP89033699
JavaScript15022

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity13.50
▷ Minimum class complexity7.00
▷ Maximum class complexity20.00
Average method complexity2.39
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.57MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png197.49KB62.62KB▼ 68.29%
img/twitter.png3.46KB2.07KB▼ 40.11%
img/facebook.png4.16KB2.32KB▼ 44.35%
screenshot-1.png177.87KB52.71KB▼ 70.37%
img/wordpress.png4.79KB2.37KB▼ 50.49%