10% tb-testimonials

Code Review | TBTestimonials

WordPress plugin TBTestimonials scored10%from 54 tests.

About plugin

  • Plugin page: tb-testimonials
  • Plugin version: 1.7.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.6
  • WordPress version: 6.3.1
  • First release: Jul 31, 2010
  • Latest release: Jul 20, 2013
  • Number of updates: 108
  • Update frequency: every 10.1 days
  • Top authors: ansimation (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /29,582 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/tb-testimonials/tbtestimonials-widget.php+6
    Methods with the same name as their class will not be constructors in a future version of PHP; TBTestimonialsWidget has a deprecated constructor

Server metrics [RAM: ▼1.56MB] [CPU: ▼49.05ms] Passed 4 tests

A check of server-side resources used by TBTestimonials
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.43 ▼1.047.61 ▼28.01
Dashboard /wp-admin2.45 ▼0.867.74 ▼42.69
Posts /wp-admin/edit.php2.45 ▼0.917.25 ▼40.85
Add New Post /wp-admin/post-new.php2.45 ▼3.447.71 ▼84.64
Media Library /wp-admin/upload.php2.45 ▼0.798.33 ▼27.01
General Settings /wp-admin/edit.php?post_type=testimonial&page=tbtestimonials-settings2.456.51
Categories /wp-admin/edit-tags.php?taxonomy=tbtestimonial_category&post_type=testimonial2.458.17
Add A Testimonial /wp-admin/post-new.php?post_type=testimonial2.456.67
Output Templates /wp-admin/edit.php?post_type=testimonial&page=tbtestimonials-output-templates2.459.04
Documentation /wp-admin/edit.php?post_type=testimonial&page=tbtestimonials-documentation2.457.26
Testimonials /wp-admin/edit.php?post_type=testimonial2.4510.14

Server storage [IO: ▲1.77MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 219 new files
Database: no new tables, 11 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
tbt_templates
tbtestimonials_preloaders
db_upgraded
tbtestimonials_output_settings
widget_tbtestimonialswidget
tbtestimonials_settings
...

Browser metrics Passed 4 tests

Checking browser requirements for TBTestimonials
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲8014.10 ▼0.062.02 ▲0.5043.91 ▲5.81
Dashboard /wp-admin2,240 ▲665.67 ▲0.0882.55 ▼5.7240.05 ▼1.64
Posts /wp-admin/edit.php2,147 ▲472.04 ▲0.0141.17 ▲6.3135.54 ▼6.65
Add New Post /wp-admin/post-new.php1,565 ▲3023.31 ▲5.03694.70 ▲56.9269.59 ▼0.91
Media Library /wp-admin/upload.php1,445 ▲454.15 ▲0.01106.75 ▼6.9139.83 ▼9.48
General Settings /wp-admin/edit.php?post_type=testimonial&page=tbtestimonials-settings1,0351.7024.9435.92
Categories /wp-admin/edit-tags.php?taxonomy=tbtestimonial_category&post_type=testimonial1,3192.1226.7029.34
Add A Testimonial /wp-admin/post-new.php?post_type=testimonial2,5158.10167.1376.51
Output Templates /wp-admin/edit.php?post_type=testimonial&page=tbtestimonials-output-templates1,8103.9491.3384.10
Documentation /wp-admin/edit.php?post_type=testimonial&page=tbtestimonials-documentation1,5722.0538.2150.22
Testimonials /wp-admin/edit.php?post_type=testimonial1,1181.9833.1530.04

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/tb-testimonials/tbtestimonials-widget.php+6
    Methods with the same name as their class will not be constructors in a future version of PHP; TBTestimonialsWidget has a deprecated constructor
  • This plugin does not fully uninstall, leaving 11 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • tbt_templates
    • tbtestimonials_preloaders
    • tbtestimonials_output_settings
    • widget_recent-comments
    • tbtestimonials_settings
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • ...

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
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=testimonial
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/tb-testimonials/tbtestimonials-widget.php+6
    Methods with the same name as their class will not be constructors in a future version of PHP; TBTestimonialsWidget has a deprecated constructor
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=testimonial
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/tb-testimonials/tbtestimonials-widget.php+324
    Function create_function() is deprecated
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=testimonial
    • > POST request to /wp-admin/admin-ajax.php
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in TBTestimonialsWidget is deprecated since version 4.3.0! Use __construct() instead.

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/tb-testimonials/inc/tpl/documentation.php
    • > /wp-content/plugins/tb-testimonials/inc/twig/bin/create_pear_package.php
  • 135× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression' not found in wp-content/plugins/tb-testimonials/inc/twig/lib/Twig/Node/Expression/GetAttr.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_NodeInterface' not found in wp-content/plugins/tb-testimonials/inc/twig/lib/Twig/Node.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Module' not found in wp-content/plugins/tb-testimonials/inc/twig/lib/Twig/Node/SandboxedModule.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/tb-testimonials/inc/twig/lib/Twig/Node/Include.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_LexerInterface' not found in wp-content/plugins/tb-testimonials/inc/twig/lib/Twig/Lexer.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_TokenParserInterface' not found in wp-content/plugins/tb-testimonials/inc/twig/lib/Twig/TokenParser.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/tb-testimonials/inc/twig/lib/Twig/TokenParser/Macro.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/tb-testimonials/inc/twig/lib/Twig/Node/Print.php:19
    • > PHP Notice
      Trying to get property 'templates' of non-object in wp-content/plugins/tb-testimonials/inc/tpl/syntax-settings-api.php on line 53
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_TestInterface' not found in wp-content/plugins/tb-testimonials/inc/twig/lib/Twig/Test/Function.php:18

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Main testimonial listing), #2 (Add a testimonial page), #3 (General Plugin Settings), #4 (Output Templates), #5 (Template Tags), #6 (Create New Template), #7 (Documentation)
  • Tags: There are too many tags (13 tag instead of maximum 10)
You can look at the official readme.txt

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

The principal PHP file in "TBTestimonials" v. 1.7.3 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 186 characters long)

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
There were no executable files found in this plugin12,572 lines of code in 191 files:
LanguageFilesBlank linesComment linesLines of code
PHP1611,7374,6348,368
JavaScript184186353,214
C1154136735
CSS5321148
JSON10031
C/C++ Header1101326
XML12023
Markdown16011
YAML13011
m41215

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity7.03
▷ Minimum class complexity1.00
▷ Maximum class complexity128.00
Average method complexity2.51
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces15
Traits0
Classes139
▷ Abstract classes85.76%
▷ Concrete classes13194.24%
▷ Final classes00.00%
Methods667
▷ Static methods50.75%
▷ Public methods59889.66%
▷ Protected methods6910.34%
▷ Private methods00.00%
Functions42
▷ Named functions42100.00%
▷ Anonymous functions00.00%
Constants36
▷ Global constants12.78%
▷ Class constants3597.22%
▷ Public constants35100.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
10 PNG files occupy 1.07MB with 0.65MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png217.74KB72.98KB▼ 66.48%
inc/i/tbdlogo.png20.67KB10.61KB▼ 48.67%
screenshot-5.png108.28KB41.98KB▼ 61.23%
inc/i/pillow_128.png14.59KB4.42KB▼ 69.71%
screenshot-7.png171.90KB69.15KB▼ 59.78%