73% tp-gallery-slider

Code Review | T&P Gallery Slider

WordPress plugin T&P Gallery Slider scored73%from 54 tests.

About plugin

  • Plugin page: tp-gallery-slider
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5.1
  • WordPress version: 6.3.1
  • First release: Dec 21, 2012
  • Latest release: Aug 23, 2013
  • Number of updates: 18
  • Update frequency: every 13.7 days
  • Top authors: pey22 (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /13,763 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.96MB] [CPU: ▼39.20ms] Passed 4 tests

An overview of server-side resources used by T&P Gallery Slider
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.72 ▼0.34
Dashboard /wp-admin3.00 ▼0.3522.44 ▼42.64
Posts /wp-admin/edit.php3.00 ▼0.3624.43 ▼24.11
Add New Post /wp-admin/post-new.php3.00 ▼2.8924.36 ▼78.36
Media Library /wp-admin/upload.php3.00 ▼0.2325.89 ▼11.68

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for T&P Gallery Slider
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,889 ▲12813.49 ▼0.868.79 ▲7.0242.87 ▼0.54
Dashboard /wp-admin2,211 ▲345.63 ▼0.04100.90 ▲6.8638.69 ▲0.44
Posts /wp-admin/edit.php2,116 ▲162.04 ▲0.0341.54 ▲4.1337.96 ▲1.31
Add New Post /wp-admin/post-new.php1,539 ▲1323.52 ▲0.42622.13 ▼43.3157.34 ▼0.77
Media Library /wp-admin/upload.php1,419 ▲194.19 ▼0.0399.38 ▼14.2245.40 ▼5.93

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tp-gallery-slider/tp_gallery_slider.php:284

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (12 tag instead of maximum 10)
  • Screenshots: These screenshots do not have images: #1 (screenshot-1.png), #2 (screenshot-2.png)
The official readme.txt might help

tp-gallery-slider/tp_gallery_slider.php 92% from 13 tests

This is the main PHP file of "T&P Gallery Slider" version 1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("tp-gallery-slider.php" instead of "tp_gallery_slider.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 plugin336 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP16940336

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.69MB with 0.31MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icons/pic.png2.06KB1.84KB▼ 10.72%
icons/cut.png1.49KB1.04KB▼ 30.02%
screenshot-2.png326.41KB102.39KB▼ 68.63%
screenshot-1.png372.13KB115.61KB▼ 68.93%