10% mobile-theme

Code Review | Mobile Theme

WordPress plugin Mobile Theme scored10%from 54 tests.

About plugin

  • Plugin page: mobile-theme
  • Plugin version: 1.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: May 22, 2013
  • Latest release: May 22, 2019
  • Number of updates: 19
  • Update frequency: every 115.3 days
  • Top authors: PressLabs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /9,960 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/mobile-theme/mobile-theme.php+144
    Trying to access array offset on value of type bool

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

Analyzing server-side resources used by Mobile Theme
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.29 ▼7.89
Dashboard /wp-admin3.33 ▲0.0244.56 ▼1.31
Posts /wp-admin/edit.php3.38 ▲0.0246.31 ▼1.89
Add New Post /wp-admin/post-new.php5.91 ▲0.0280.70 ▼9.84
Media Library /wp-admin/upload.php3.25 ▲0.0235.14 ▲0.63
Mobile Theme /wp-admin/themes.php?page=mobile-theme/mobile-theme.php3.2128.67

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
mobile_theme_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Mobile Theme
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4714.40 ▼0.351.68 ▼0.5339.34 ▼14.42
Dashboard /wp-admin2,210 ▲194.86 ▼1.05111.57 ▲0.2142.14 ▲1.54
Posts /wp-admin/edit.php2,093 ▲12.11 ▲0.0938.57 ▲4.7436.26 ▲3.34
Add New Post /wp-admin/post-new.php1,545 ▲3118.18 ▲0.63624.40 ▼60.0650.15 ▼1.25
Media Library /wp-admin/upload.php1,395 ▲44.19 ▼0.0095.65 ▼8.0043.22 ▼2.11
Mobile Theme /wp-admin/themes.php?page=mobile-theme/mobile-theme.php8402.0526.3327.55

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

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/themes.php?page=mobile-theme/mobile-theme.php
    • > Notice in wp-content/plugins/mobile-theme/mobile-theme.php+341
    Undefined variable: mobile_theme_disabled_message

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
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/mobile-theme/mobile-theme.php on line 13
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/mobile-theme/mobile-theme.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_plugin_active() in wp-content/plugins/mobile-theme/mobile-theme.php:69
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/mobile-theme/mobile-theme.php on line 13

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

Often overlooked, readme.txt is one of the most important files in your plugin
No tags were found

mobile-theme/mobile-theme.php Passed 13 tests

"Mobile Theme" version 1.3.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
134 characters long description:
This plugin switches the current theme to the mobile one when it detects a mobile device. This plugin works only on Presslabs servers!

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin294 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP15419294

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
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%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin