79% tp-next-previous-button-in-single-product-page

Code Review | TP Next & Previous Button on Single Product Page

WordPress plugin TP Next & Previous Button on Single Product Page scored 79% from 54 tests.

About plugin

  • Plugin page: tp-next-previous-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.8.1
  • WordPress version: 6.3.1
  • First release: Aug 11, 2021
  • Latest release: Nov 7, 2021
  • Number of updates: 5
  • Update frequency: every 17.8 days
  • Top authors: tplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,183 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▲0.40ms] Passed 4 tests

Server-side resources used by TP Next & Previous Button on Single Product Page
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1339.02 ▼7.60
Dashboard /wp-admin3.42 ▲0.1254.73 ▲0.94
Posts /wp-admin/edit.php3.54 ▲0.1855.79 ▲5.07
Add New Post /wp-admin/post-new.php6.02 ▲0.14102.67 ▲3.51
Media Library /wp-admin/upload.php3.35 ▲0.1243.26 ▲4.75

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 54 new files
Database: no new tables, 18 new options
New WordPress options
tpnpb_add_product_image
tpnpb_buttons_position
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
tpnpb_add_product_name
tpnpb_activate_next_previous
tpnpb_label_next
tpnpb_buttons_icons
...

Browser metrics Passed 4 tests

TP Next & Previous Button on Single Product Page: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,910 ▲12113.72 ▲0.554.92 ▲3.1841.05 ▼5.40
Dashboard /wp-admin2,217 ▲114.94 ▲0.10110.19 ▼2.0274.17 ▲26.78
Posts /wp-admin/edit.php2,115 ▲262.22 ▲0.1839.00 ▲4.3133.59 ▲1.78
Add New Post /wp-admin/post-new.php1,576 ▲3419.49 ▼3.44728.43 ▲40.6458.94 ▲6.98
Media Library /wp-admin/upload.php1,414 ▲264.41 ▲0.18111.26 ▲3.9647.09 ▲3.32

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/tp-next-previous-button-in-single-product-page/public/partials/tp-next-previous-button-in-single-product-page-public-display.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tp-next-previous-button-in-single-product-page/admin/partials/tp-next-previous-button-in-single-product-page-admin-display.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

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
5 plugin tags: next and previous buttons, product, woocommerce, woocommerce product, next and previous buttons in single product page

tp-next-previous-button-in-single-product-page/tp-next-previous-button-in-single-product-page.php Passed 13 tests

This is the main PHP file of "TP Next & Previous Button on Single Product Page" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
96 characters long description:
This is a short description of what the plugin does. It's displayed in the WordPress admin area.

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
Success! There were no dangerous files found in this plugin3,099 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
CSS9158981,739
PHP12203507501
HTML191409
JSON100358
SVG157069
JavaScript393523

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity3.14
▷ Minimum class complexity1.00
▷ Maximum class complexity10.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods27
▷ Static methods27.41%
▷ Public methods2281.48%
▷ Protected methods00.00%
▷ Private methods518.52%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.13MB with 0.09MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/jquery.minicolors.png67.02KB34.31KB▼ 48.80%
admin/images/tp.png1.24KB0.26KB▼ 79.08%
admin/partials/images/jquery.minicolors.png67.02KB34.31KB▼ 48.80%
admin/partials/images/tp.png1.24KB0.26KB▼ 79.08%