78% tw-switch-mobile-domain

Code Review | TW Switch Mobile Domain

WordPress plugin TW Switch Mobile Domain scored78%from 54 tests.

About plugin

  • Plugin page: tw-switch-mobile-...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.4.2
  • WordPress version: 6.3.1
  • First release: Apr 17, 2015
  • Latest release: Apr 6, 2016
  • Number of updates: 25
  • Update frequency: every 14.3 days
  • Top authors: mrtaiw (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /3,630 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼1.94ms] Passed 4 tests

An overview of server-side resources used by TW Switch Mobile Domain
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.09 ▲2.53
Dashboard /wp-admin3.34 ▲0.0345.04 ▼5.14
Posts /wp-admin/edit.php3.39 ▲0.0349.68 ▲0.35
Add New Post /wp-admin/post-new.php5.92 ▲0.0378.43 ▼5.48
Media Library /wp-admin/upload.php3.26 ▲0.0343.12 ▲7.99
TW Mobile Domain /wp-admin/themes.php?page=tw-switch-mobile-domain3.3630.70

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 6 new options
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

TW Switch Mobile Domain: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.32 ▼0.211.81 ▲0.0445.48 ▲4.71
Dashboard /wp-admin2,199 ▲225.63 ▼0.0391.08 ▲3.0336.95 ▼7.39
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0439.46 ▲0.2037.72 ▼0.06
Add New Post /wp-admin/post-new.php1,540 ▲318.02 ▼0.10608.15 ▲4.3466.74 ▲1.51
Media Library /wp-admin/upload.php1,404 ▲14.18 ▼0.0496.57 ▲1.6642.18 ▼2.42
TW Mobile Domain /wp-admin/themes.php?page=tw-switch-mobile-domain8782.0023.2128.29

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/themes.php?page=tw-switch-mobile-domain
    • > User deprecated in wp-includes/functions.php+5453
    Function get_current_theme is deprecated since version 3.4.0! Use wp_get_theme() instead.

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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/tw-switch-mobile-domain/tw-switch-mobile-domain.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% 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 require attention: You can take inspiration from this readme.txt

tw-switch-mobile-domain/tw-switch-mobile-domain.php Passed 13 tests

"TW Switch Mobile Domain" version 1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
49 characters long description:
Redirect to Mobile domain and switch mobile theme

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
Good job! No executable or dangerous file extensions detected129 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1288129

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity30.00
▷ Minimum class complexity30.00
▷ Maximum class complexity30.00
Average method complexity3.90
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods990.00%
▷ Protected methods00.00%
▷ Private methods110.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There are no PNG files in this plugin