10% wp-testimonial-widget

Code Review | WP Testimonial Widget

WordPress plugin WP Testimonial Widget scored10%from 54 tests.

About plugin

  • Plugin page: wp-testimonial-wi...
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 6.3.1
  • First release: Dec 15, 2012
  • Latest release: Oct 14, 2017
  • Number of updates: 37
  • Update frequency: every 47.8 days
  • Top authors: starkinfo (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

600+ active /26,041 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/wp-testimonial-widget/testimonial_widget.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; SWP_Testimonial_Widget has a deprecated constructor

Server metrics [RAM: ▼1.69MB] [CPU: ▼53.77ms] Passed 4 tests

Analyzing server-side resources used by WP Testimonial Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.30 ▼1.177.20 ▼31.48
Dashboard /wp-admin2.32 ▼0.997.78 ▼46.85
Posts /wp-admin/edit.php2.32 ▼1.047.13 ▼43.80
Add New Post /wp-admin/post-new.php2.32 ▼3.577.02 ▼92.94
Media Library /wp-admin/upload.php2.32 ▼0.917.55 ▼28.39
Categories /wp-admin/admin.php?page=testimonail_category2.328.59
Help /wp-admin/admin.php?page=help2.328.19
Re Order /wp-admin/admin.php?page=re-order2.326.11
Testimonials /wp-admin/admin.php?page=testimonial2.326.67
Settings /wp-admin/admin.php?page=setting2.326.38

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 42 new files
Database: 2 new tables, 7 new options
New tables
wp_swp_testimonial
wp_swp_category
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_swp_testimonial_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Testimonial Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,088 ▲34215.83 ▲1.225.47 ▲3.8337.83 ▼0.02
Dashboard /wp-admin2,392 ▲2107.15 ▲1.28132.57 ▲27.7195.76 ▲51.88
Posts /wp-admin/edit.php2,315 ▲2263.76 ▲1.7152.70 ▲16.0766.78 ▲32.39
Add New Post /wp-admin/post-new.php1,573 ▲5923.65 ▲6.08652.13 ▼31.32174.26 ▲121.01
Media Library /wp-admin/upload.php1,455 ▲644.98 ▲0.7485.31 ▼10.6187.08 ▲44.29
Categories /wp-admin/admin.php?page=testimonail_category1,2513.8851.4670.47
Help /wp-admin/admin.php?page=help1,2133.7944.8366.83
Re Order /wp-admin/admin.php?page=re-order1,0203.8347.4549.30
Testimonials /wp-admin/admin.php?page=testimonial1,3894.0549.3872.30
Settings /wp-admin/admin.php?page=setting1,0163.8043.8473.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/wp-testimonial-widget/testimonial_widget.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; SWP_Testimonial_Widget has a deprecated constructor
  • Zombie tables detected upon uninstall: 2 tables
    • wp_swp_testimonial
    • wp_swp_category
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_swp_testimonial_widget
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=setting
    • > Deprecated in wp-content/plugins/wp-testimonial-widget/testimonial_widget.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; SWP_Testimonial_Widget has a deprecated constructor
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=setting
    • > Deprecated in wp-content/plugins/wp-testimonial-widget/functions.php+93
    Function create_function() is deprecated
    • > GET request to /wp-admin/admin.php?page=testimonail_category
    • > Warning in wp-content/plugins/wp-testimonial-widget/category.php+229
    Use of undefined constant CHILD_IMG - assumed 'CHILD_IMG' (this will throw an Error in a future version of PHP)

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-testimonial-widget/add_testimonial.php
  • 15× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-testimonial-widget/setting.php:6
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-testimonial-widget/functions.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/wp-testimonial-widget/re-order.php:4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/wp-testimonial-widget/category.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_style() in wp-content/plugins/wp-testimonial-widget/help.php:3
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-testimonial-widget/add_testimonial.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-testimonial-widget/add-shortcode.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-testimonial-widget/testimonial_widget.php:5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-testimonial-widget/category.php on line 4
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-testimonial-widget/re-order.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Manage testimonials), #2 (Widget options), #3 (Re order testimonial page), #4 (Help)
The official readme.txt is a good inspiration

wp-testimonial-widget/swp-testimonial.php 92% from 13 tests

The main PHP file in "WP Testimonial Widget" ver. 3.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-testimonial-widget.php" instead of "swp-testimonial.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected4,079 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP112112231,842
JavaScript92392071,470
CSS78851767

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity35.33
▷ Minimum class complexity9.00
▷ Maximum class complexity77.00
Average method complexity4.46
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods30
▷ Static methods00.00%
▷ Public methods30100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions31
▷ Named functions31100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
14 PNG files occupy 0.26MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/quote-after.png1.07KB0.22KB▼ 79.21%
images/testimonial.png8.54KB2.96KB▼ 65.34%
images/quote-before.png1.08KB0.24KB▼ 77.72%
images/icon.png1.58KB0.74KB▼ 53.16%
(invalid) images/profile.png3.26KB0.00KB▼ 100.00%