84% tr-post-slider-widget

Code Review | TR Post Slider Widget

WordPress plugin TR Post Slider Widget scored84%from 54 tests.

About plugin

  • Plugin page: tr-post-slider-wi...
  • Plugin version: 3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.7
  • WordPress version: 6.3.1
  • First release: Dec 17, 2014
  • Latest release: Mar 10, 2021
  • Number of updates: 16
  • Update frequency: every 142.2 days
  • Top authors: MohammadTanzilurRahman (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

300+ active /12,173 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.03MB] [CPU: ▼17.94ms] Passed 4 tests

A check of server-side resources used by TR Post Slider Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0440.16 ▼53.76
Dashboard /wp-admin3.33 ▲0.0350.07 ▼6.85
Posts /wp-admin/edit.php3.38 ▲0.0345.76 ▼3.20
Add New Post /wp-admin/post-new.php5.91 ▲0.0387.44 ▼7.94
Media Library /wp-admin/upload.php3.25 ▲0.0234.95 ▲3.07

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_tr_ps_widget
can_compress_scripts
widget_recent-comments
widget_tr_pwt_widget
widget_theysaidso_widget
widget_tr_fs_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for TR Post Slider Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲14113.62 ▼1.166.43 ▲2.7943.79 ▼20.74
Dashboard /wp-admin2,203 ▲215.86 ▼0.18122.69 ▼26.1846.96 ▼12.54
Posts /wp-admin/edit.php2,089 ▼32.02 ▼0.0336.50 ▼6.0732.51 ▼3.92
Add New Post /wp-admin/post-new.php1,533 ▲1923.09 ▲5.65656.20 ▼33.7454.16 ▼0.55
Media Library /wp-admin/upload.php1,388 ▼04.21 ▲0.07103.24 ▲1.5541.33 ▼0.72

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-comments
    • widget_tr_ps_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_tr_pwt_widget
    • widget_tr_fs_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/tr-post-slider-widget/widget-post-featured-image.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/tr-post-slider-widget/tr-post-slider-widget.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/tr-post-slider-widget/widget-post-content.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/tr-post-slider-widget/widget-post-with-thumbnail.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
9 plugin tags: post slider widget, post slider, wordpress post, carousel post widget, post widget...

tr-post-slider-widget/tr-post-slider-widget.php Passed 13 tests

The primary PHP file in "TR Post Slider Widget" version 3.2 is used by WordPress to initiate all plugin functionality
81 characters long description:
Using this free post slider widget plugin you can show your posts in a slideshow.

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
Everything looks great! No dangerous files found in this plugin2,283 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript21231211,346
PHP48111754
CSS258183

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity48.33
▷ Minimum class complexity44.00
▷ Maximum class complexity51.00
Average method complexity12.83
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/left-arrow.png0.30KB0.35KB0.00%
img/right-arrow.png0.30KB0.35KB0.00%