84% mobile-detect-for-css

Code Review | Mobile Detect For CSS

WordPress plugin Mobile Detect For CSS scored84%from 54 tests.

About plugin

  • Plugin page: mobile-detect-for...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.4.2
  • WordPress version: 6.3.1
  • First release: Mar 13, 2014
  • Latest release: Apr 5, 2016
  • Number of updates: 14
  • Update frequency: every 53.9 days
  • Top authors: svincoll4 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,867 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼1.21ms] Passed 4 tests

Analyzing server-side resources used by Mobile Detect For CSS
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.99 ▲3.29
Dashboard /wp-admin3.31 ▲0.0042.97 ▲1.28
Posts /wp-admin/edit.php3.36 ▲0.0044.15 ▼4.29
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.17 ▼0.99
Media Library /wp-admin/upload.php3.23 ▲0.0033.54 ▼0.85

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Mobile Detect For CSS
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.16 ▼1.241.58 ▼0.5341.09 ▼3.29
Dashboard /wp-admin2,206 ▲184.85 ▼0.04111.73 ▼2.8537.84 ▼7.15
Posts /wp-admin/edit.php2,089 ▲32.01 ▼0.0239.43 ▲1.2134.30 ▲0.55
Add New Post /wp-admin/post-new.php1,533 ▼023.27 ▲0.17607.23 ▼39.4847.74 ▼28.31
Media Library /wp-admin/upload.php1,391 ▲34.28 ▲0.0897.98 ▼0.7840.29 ▼1.87

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mobile-detect-for-css/mobile-detect-for-css.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (On mobile), #2 (On tablet)
Please take inspiration from this readme.txt

mobile-detect-for-css/mobile-detect-for-css.php Passed 13 tests

The entry point to "Mobile Detect For CSS" version 1.3 is a PHP file that has certain tags in its header comment area
48 characters long description:
This plugin add the device css class to BODY tag

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
Everything looks great! No dangerous files found in this plugin686 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2168639686

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 code1.02
Average class complexity72.50
▷ Minimum class complexity11.00
▷ Maximum class complexity134.00
Average method complexity4.86
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods37
▷ Static methods924.32%
▷ Public methods3594.59%
▷ Protected methods25.41%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
PNG images were not found in this plugin