10% siteselector

Code Review | Siteselector

WordPress plugin Siteselector scored10%from 54 tests.

About plugin

  • Plugin page: siteselector
  • Plugin version: 1.01
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.3.1
  • WordPress version: 6.3.1
  • First release: Nov 9, 2015
  • Latest release: Aug 9, 2017
  • Number of updates: 26
  • Update frequency: every 24.4 days
  • Top authors: scideas (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /808 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/siteselector/common.php+132
    count(): Parameter must be an array or an object that implements Countable

Server metrics [RAM: ▲0.08MB] [CPU: ▼2.45ms] Passed 4 tests

An overview of server-side resources used by Siteselector
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0939.12 ▲0.05
Dashboard /wp-admin3.39 ▲0.0849.77 ▲1.17
Posts /wp-admin/edit.php3.51 ▲0.1546.68 ▼0.97
Add New Post /wp-admin/post-new.php5.97 ▲0.0882.36 ▼5.72
Media Library /wp-admin/upload.php3.32 ▲0.0833.30 ▼3.15
Siteselector Search /wp-admin/admin.php?page=siteselector_search3.3135.51
Siteselector Config /wp-admin/admin.php?page=siteselector_config3.3030.26

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 23 new files
Database: 1 new table, 6 new options
New tables
wp_siteselector_config
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Siteselector: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,909 ▲14813.59 ▼0.768.36 ▲6.8242.94 ▲1.18
Dashboard /wp-admin2,231 ▲515.67 ▲0.0396.07 ▲2.9740.21 ▼4.37
Posts /wp-admin/edit.php2,133 ▲332.00 ▼0.0334.79 ▼3.0729.70 ▼7.22
Add New Post /wp-admin/post-new.php1,552 ▲2623.12 ▼0.39643.28 ▼11.9453.53 ▼1.93
Media Library /wp-admin/upload.php1,431 ▲284.22 ▲0.0495.82 ▼1.3538.32 ▼7.58
Siteselector Search /wp-admin/admin.php?page=siteselector_search1,1192.0929.5288.39
Siteselector Config /wp-admin/admin.php?page=siteselector_config9352.1230.7533.75

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie tables detected upon uninstall: 1 table
    • wp_siteselector_config
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% 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 server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=siteselector_search
    • > Notice in wp-content/plugins/siteselector/siteselector_search.php+306
    Undefined variable: goesLeft
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=siteselector_search
    • > Notice in wp-content/plugins/siteselector/siteselector_search.php+402
    Undefined variable: domain
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=siteselector_search
    • > Notice in wp-content/plugins/siteselector/siteselector_search.php+402
    Undefined variable: key
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=siteselector_search
    • > Notice in wp-content/plugins/siteselector/siteselector_search.php+430
    Undefined variable: spamNumber
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=siteselector_config
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/siteselector/common.php+132
    count(): Parameter must be an array or an object that implements Countable
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=siteselector_config
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/siteselector/siteselector_functions.php+131
    Trying to access array offset on value of type null

SRP 50% 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
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/siteselector/common.php on line 4
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/siteselector/common.php on line 18
    • > PHP Notice
      Undefined variable: ub in wp-content/plugins/siteselector/common.php on line 82
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/siteselector/siteselector_config.php:21
    • > PHP Notice
      Undefined variable: ub in wp-content/plugins/siteselector/common.php on line 94
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/siteselector/siteselector_search.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/siteselector/siteselector_functions.php:16
    • > PHP Notice
      Undefined offset: 1 in wp-content/plugins/siteselector/common.php on line 98

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=siteselector_search
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=siteselector_search 157:7 Uncaught TypeError: Cannot read properties of null (reading 'status')
    • > GET request to /wp-admin/admin.php?page=siteselector_config
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=siteselector_config 158:7 Uncaught TypeError: Cannot read properties of null (reading 'status')

Optimizations

Plugin configuration 90% 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 need to be fixed:
  • Donate link: Please fix this invalid URI: ""
You can look at the official readme.txt

siteselector/siteselector_functions.php 85% from 13 tests

"Siteselector" version 1.01'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:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Main file name: The principal plugin file should be the same as the plugin slug ("siteselector.php" instead of "siteselector_functions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin2,672 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP41351071,109
CSS21763935
JavaScript11241353
HTML15378275

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
4 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
media/VenLogo3.png38.71KB12.44KB▼ 67.86%
media/close.png6.53KB3.01KB▼ 53.91%
media/blue_tick.png3.48KB0.94KB▼ 73.01%
media/black_cross.png3.59KB1.04KB▼ 70.94%