84% pt-variants

Code Review | PT Variants

WordPress plugin PT Variants scored84%from 54 tests.

About plugin

  • Plugin page: pt-variants
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.1-4.2.2
  • WordPress version: 6.3.1
  • First release: May 28, 2015
  • Latest release: May 29, 2015
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: pereirinha (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /2,143 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.20ms] Passed 4 tests

This is a short check of server-side resources used by PT Variants
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0243.30 ▲2.58
Dashboard /wp-admin3.33 ▲0.0248.56 ▼3.90
Posts /wp-admin/edit.php3.38 ▲0.0248.04 ▲0.72
Add New Post /wp-admin/post-new.php5.91 ▲0.0284.90 ▼5.06
Media Library /wp-admin/upload.php3.25 ▲0.0236.83 ▼0.57

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 9 new options
New WordPress options
pt_variants_be
db_upgraded
pt_variants_version
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
pt_variants_fe

Browser metrics Passed 4 tests

Checking browser requirements for PT Variants
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▲0.102.35 ▲0.4744.44 ▼1.88
Dashboard /wp-admin2,195 ▲185.65 ▼0.0286.38 ▼17.8242.13 ▼1.99
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0135.69 ▼4.7535.79 ▼0.44
Add New Post /wp-admin/post-new.php1,526 ▼223.22 ▲0.02615.73 ▼70.8557.02 ▲1.37
Media Library /wp-admin/upload.php1,397 ▼04.20 ▼0.04103.79 ▼2.7443.07 ▼3.16

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • db_upgraded
    • can_compress_scripts
    • pt_variants_fe
    • pt_variants_version
    • theysaidso_admin_options
    • widget_recent-posts
    • pt_variants_be
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/pt-variants/pt-variants.php

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (Options > General page is where you define which variants will be used in each scenario. [Click for larger image view](https://s.w.org/plugins/pt-variants/screenshot-1.jpg))
Please take inspiration from this readme.txt

pt-variants/pt-variants.php 92% from 13 tests

"PT Variants" version 0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 263 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin19,026 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PO File78,60110,55918,871
PHP12836122
Markdown124033

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods675.00%
▷ Protected methods00.00%
▷ Private methods225.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin