77% thnks

Code Review | Thnks

WordPress plugin Thnks scored77%from 54 tests.

About plugin

  • Plugin page: thnks
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.2
  • WordPress version: 6.3.1
  • First release: Jun 2, 2023
  • Latest release: Jun 3, 2023
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: marcomireles (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /78 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: ▼7.01ms] Passed 4 tests

This is a short check of server-side resources used by Thnks
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0744.77 ▲0.06
Dashboard /wp-admin3.33 ▼0.0148.85 ▼20.00
Posts /wp-admin/edit.php3.38 ▲0.0351.31 ▲3.93
Add New Post /wp-admin/post-new.php5.91 ▲0.0397.13 ▼2.41
Media Library /wp-admin/upload.php3.26 ▲0.0334.04 ▼5.67

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 48 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Thnks
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6014.73 ▲0.381.72 ▼0.1243.81 ▼1.91
Dashboard /wp-admin2,212 ▲325.63 ▼0.0292.57 ▼3.1744.22 ▲4.83
Posts /wp-admin/edit.php2,117 ▲141.96 ▼0.0540.22 ▲1.1938.58 ▲2.65
Add New Post /wp-admin/post-new.php1,538 ▼023.22 ▼0.00696.28 ▲55.6055.14 ▲3.45
Media Library /wp-admin/upload.php1,417 ▲174.22 ▲0.0499.58 ▼1.2445.08 ▼0.99

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% 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 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/thnks/views/fields/products/products-selector.php
  • 17× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/thnks/views/fields/default-template/default-colors.php:4
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/thnks/views/fields/default-template/thank-you-message.php:3
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/thnks/views/fields/settings/enable-thnks.php:2
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/thnks/views/fields/default-template/support-box-color.php:4
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/thnks/views/fields/default-template/provide-information.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/thnks/templates/simple-template.php:8
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/thnks/views/fields/products/products-text-color-btn.php:4
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/thnks/views/fields/products/products-selector.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/thnks/views/fields/products/products-selector.php on line 3
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/thnks/views/fields/default-template/information-channel.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Settings), #2 (Default page), #3 (Custom styles), #4 (Product), #5 (Demo)
The official readme.txt might help

thnks/thnks.php 77% from 13 tests

The main PHP file in "Thnks" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Description: Please improve your description making it at least 10 characters long (currently 6 characters long)
  • Git Repository: A Git repository was detected inside this plugin

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,682 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP187481861
CSS83611372
Sass393355
JavaScript3141894

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity7.33
▷ Minimum class complexity6.00
▷ Maximum class complexity8.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods34
▷ Static methods38.82%
▷ Public methods34100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
10 PNG files occupy 0.61MB with 0.37MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/Default page.png88.36KB29.13KB▼ 67.03%
assets/img/icon-128x128.png9.94KB4.95KB▼ 50.20%
assets/img/Custom styles.png97.03KB31.69KB▼ 67.34%
assets/img/Product.png92.18KB30.36KB▼ 67.07%
assets/img/icon-256x256.png21.47KB10.24KB▼ 52.29%