74% ss-device-detector

Code Review | SS Device Detector

WordPress plugin SS Device Detector scored74%from 54 tests.

About plugin

  • Plugin page: ss-device-detector
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.1.1
  • WordPress version: 6.3.1
  • First release: Jul 25, 2014
  • Latest release: Mar 11, 2015
  • Number of updates: 14
  • Update frequency: every 16.4 days
  • Top authors: vladiiancu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,196 total downloads

Benchmarks

Plugin footprint 65% 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 gracefully, with no errors

Server metrics [RAM: ▲0.15MB] [CPU: ▼3.00ms] Passed 4 tests

This is a short check of server-side resources used by SS Device Detector
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1540.93 ▲1.62
Dashboard /wp-admin3.45 ▲0.1546.18 ▼5.05
Posts /wp-admin/edit.php3.57 ▲0.2153.17 ▲3.46
Add New Post /wp-admin/post-new.php6.03 ▲0.1584.67 ▼10.60
Media Library /wp-admin/upload.php3.37 ▲0.1537.74 ▲2.05

Server storage [IO: ▲0.10MB] [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: 5 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
wp_mobcodes_deferred_admin_notices
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for SS Device Detector
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.31 ▼1.071.71 ▼0.1344.95 ▲4.54
Dashboard /wp-admin2,209 ▲245.85 ▲0.0199.12 ▼3.1036.18 ▼4.18
Posts /wp-admin/edit.php2,092 ▲32.10 ▲0.0643.08 ▲6.7237.65 ▲1.13
Add New Post /wp-admin/post-new.php1,542 ▲918.03 ▼5.58658.75 ▼25.6670.51 ▲6.15
Media Library /wp-admin/upload.php1,385 ▲34.22 ▼0.1096.98 ▼4.8240.37 ▼4.73

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SS_DeviceDetector::wp_mobcodes_deactivation() should not be called statically
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • wp_mobcodes_deferred_admin_notices

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/ss-device-detector/ss-device-detector.php:85

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: ress, shortcode, content, responsive, adaptive

ss-device-detector/ss-device-detector.php Passed 13 tests

The entry point to "SS Device Detector" version 1.0.4 is a PHP file that has certain tags in its header comment area
99 characters long description:
Server-side solution to detect mobile, tablet and desktop devices. Creates functions and shortcodes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin720 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2175627703
Markdown19017

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.90
Average class complexity66.00
▷ Minimum class complexity9.00
▷ Maximum class complexity123.00
Average method complexity4.42
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods38
▷ Static methods1231.58%
▷ Public methods3694.74%
▷ Protected methods25.26%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin