84% text-selection-color

Code Review | Text Selection Color

WordPress plugin Text Selection Color scored84%from 54 tests.

About plugin

  • Plugin page: text-selection-color
  • Plugin version: 1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1.1
  • WordPress version: 6.3.1
  • First release: Nov 8, 2013
  • Latest release: Feb 23, 2015
  • Number of updates: 22
  • Update frequency: every 21.5 days
  • Top authors: nazmur.r (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

800+ active /18,589 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
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Text Selection Color
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.29 ▼2.78
Dashboard /wp-admin3.32 ▲0.0245.57 ▼2.01
Posts /wp-admin/edit.php3.37 ▲0.0247.03 ▲0.22
Add New Post /wp-admin/post-new.php5.92 ▲0.0491.04 ▼5.61
Media Library /wp-admin/upload.php3.24 ▲0.0237.49 ▲5.20
Text Selection Color /wp-admin/options-general.php?page=tsc_settings3.2129.99

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Text Selection Color: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲5413.62 ▼1.131.83 ▼0.7445.07 ▲2.57
Dashboard /wp-admin2,226 ▲385.14 ▲0.27102.58 ▼18.3639.28 ▼4.71
Posts /wp-admin/edit.php2,096 ▲102.50 ▲0.5040.67 ▲4.7935.63 ▲2.06
Add New Post /wp-admin/post-new.php1,535 ▲223.31 ▲0.12648.70 ▼44.8036.24 ▼31.54
Media Library /wp-admin/upload.php1,412 ▲244.22 ▼0.0296.57 ▼23.1143.37 ▼5.34
Text Selection Color /wp-admin/options-general.php?page=tsc_settings9912.2244.9929.35

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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 errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/text-selection-color/text-selection-color.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Text Selection Color settings page), #2 (Selection color preview after changing colors)
You can take inspiration from this readme.txt

text-selection-color/text-selection-color.php Passed 13 tests

"Text Selection Color" version 1.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
53 characters long description:
Change the text selection color easily in the website

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
Success! There were no dangerous files found in this plugin214 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PO File3181899
PHP1281379
JavaScript110236

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.11
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.15MB with 0.10MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png105.46KB34.64KB▼ 67.15%
screenshot-1.png50.00KB17.08KB▼ 65.85%