78% textsanity

Code Review | TextSanity

WordPress plugin TextSanity scored 78% from 54 tests.

About plugin

  • Plugin page: textsanity
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.6
  • WordPress version: 5.8.1
  • First release: Jan 29, 2021
  • Latest release: Jan 29, 2021
  • Number of updates: 4
  • Update frequency: every 5.0 days
  • Top authors: textsanity (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 99 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.33MB] [CPU: ▼136.44ms] Passed 4 tests

This is a short check of server-side resources used by TextSanity
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.12 ▲0.3950.99 ▲22.84
Dashboard /wp-admin3.43 ▲0.3750.03 ▲5.21
Posts /wp-admin/edit.php3.48 ▲0.3647.50 ▲6.36
Add New Post /wp-admin/post-new.php5.71 ▲0.2895.30 ▼562.30
Media Library /wp-admin/upload.php3.31 ▲0.3040.15 ▲4.97
Account Connection /wp-admin/admin.php?page=txsy_connection3.2836.14
Texting Widgets /wp-admin/edit.php?post_type=txsy_widget3.1728.73
Help /wp-admin/admin.php?page=txsy_help3.2734.13

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, 1 new option
New WordPress options
widget_textsanity_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for TextSanity
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,837 ▲24115.95 ▲0.449.18 ▼1.1256.07 ▲0.52
Dashboard /wp-admin3,100 ▲1695.88 ▼0.08149.53 ▼4.10191.74 ▲71.87
Posts /wp-admin/edit.php2,865 ▲1262.71 ▲0.0265.85 ▼9.4090.68 ▼1.97
Add New Post /wp-admin/post-new.php1,712 ▲12118.40 ▼0.34392.56 ▼21.47117.26 ▲6.64
Media Library /wp-admin/upload.php1,940 ▲1335.03 ▲0.01154.72 ▼8.30122.25 ▼0.40
Account Connection /wp-admin/admin.php?page=txsy_connection1,1642.8071.7772.46
Texting Widgets /wp-admin/edit.php?post_type=txsy_widget1,1602.8268.0767.72
Help /wp-admin/admin.php?page=txsy_help1,1642.0859.7075.49

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_textsanity_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=txsy_help
    • > Notice in wp-content/plugins/textsanity/views/admin_help.php+1
    Undefined variable: action

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
Please fix the following
  • 16× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/textsanity/views/front_popup.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/textsanity/views/admin_settings.php:9
    • > PHP Notice
      Undefined variable: key in wp-content/plugins/textsanity/views/admin_setting_edit.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/textsanity/views/admin_connect.php:2
    • > PHP Notice
      Undefined variable: action in wp-content/plugins/textsanity/views/admin_help.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/textsanity/views/admin_cpt_details.php:4
    • > PHP Notice
      Undefined variable: key in wp-content/plugins/textsanity/views/admin_setting_edit.php on line 4
    • > PHP Notice
      Undefined variable: key in wp-content/plugins/textsanity/views/admin_setting_edit.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/textsanity/views/admin_help.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/textsanity/views/admin_setting_edit.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
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 is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Contributors: The plugin contributors field is missing
You can take inspiration from this readme.txt

textsanity/main.php 92% from 13 tests

The main PHP file in "TextSanity" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("textsanity.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin2,424 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP14270891,582
CSS33917391
JavaScript37185355
SVG10096

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity46.50
▷ Minimum class complexity4.00
▷ Maximum class complexity118.00
Average method complexity4.37
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods54
▷ Static methods00.00%
▷ Public methods54100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/textsanity_logo_150px.png4.47KB3.38KB▼ 24.34%