73% mobile-pages

Code Review | Mobile Blocks

WordPress plugin Mobile Blocks scored73%from 54 tests.

About plugin

  • Plugin page: mobile-pages
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.0-5.9.0
  • WordPress version: 6.3.1
  • First release: Jan 22, 2021
  • Latest release: Mar 22, 2022
  • Number of updates: 6
  • Update frequency: every 71.3 days
  • Top authors: shramee (66.67%)PootlePress (50%)

Code review

54 tests

User reviews

3 reviews

Install metrics

50+ active /1,006 total downloads

Benchmarks

Plugin footprint 64% 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: ▲5.25MB] [CPU: ▲13.02ms] 50% from 4 tests

This is a short check of server-side resources used by Mobile Blocks
Please have a look at the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 958.02ms on /wp-admin/plugins.php?page=mobile-pages)
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.25MB on /wp-admin/plugins.php?page=mobile-pages)
PageMemory (MB)CPU Time (ms)
Home /9.11 ▲5.6561.98 ▲15.14
Dashboard /wp-admin9.13 ▲5.7967.67 ▲2.75
Posts /wp-admin/edit.php9.13 ▲5.7869.64 ▲26.61
Add New Post /wp-admin/post-new.php9.66 ▲3.77108.03 ▲7.58
Media Library /wp-admin/upload.php9.13 ▲5.9162.80 ▲32.41
Freemius Debug [v.2.5.0.1] /wp-admin/admin.php?page=freemius9.1352.46
Gutenberg Mobile /wp-admin/plugins.php?page=mobile-pages9.24958.02

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 198 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
fs_active_plugins
widget_theysaidso_widget
fs_accounts
db_upgraded
widget_recent-comments
fs_gdpr
fs_debug_mode

Browser metrics Passed 4 tests

A check of browser resources used by Mobile Blocks
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲7714.72 ▲0.191.76 ▼0.0927.96 ▼18.36
Dashboard /wp-admin2,219 ▲395.66 ▲0.0094.52 ▼4.5944.77 ▲2.20
Posts /wp-admin/edit.php2,122 ▲252.00 ▲0.0534.33 ▼4.7332.63 ▲0.57
Add New Post /wp-admin/post-new.php1,539 ▼323.51 ▲5.21667.39 ▲44.5453.79 ▼17.73
Media Library /wp-admin/upload.php1,415 ▲214.17 ▼0.0395.49 ▲3.0842.39 ▲2.74
Freemius Debug [v.2.5.0.1] /wp-admin/admin.php?page=freemius1,0771.6925.9828.31
Gutenberg Mobile /wp-admin/plugins.php?page=mobile-pages1,3261.8926.2449.00

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/mobile-pages/src/wp-sdk/includes/class-freemius.php+8911
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 10 options
    • fs_gdpr
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • fs_debug_mode
    • fs_active_plugins
    • db_upgraded
    • fs_accounts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/mobile-pages/src/tpl-settings-page.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/mobile-pages/src/tpl-preview.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: mobile, mobile only, gutenberg mobile, gutenberg, mobile content...

mobile-pages/plugin.php 92% from 13 tests

The main file in "Mobile Blocks" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("mobile-pages.php" instead of "plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin40,768 lines of code in 147 files:
LanguageFilesBlank linesComment linesLines of code
PHP1147,77716,84632,719
JSON3007,430
JavaScript981166480
CSS1882571
Sass314168

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
These items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,029)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity92.68
▷ Minimum class complexity1.00
▷ Maximum class complexity3,029.00
Average method complexity4.66
▷ Minimum method complexity1.00
▷ Maximum method complexity89.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes47
▷ Abstract classes24.26%
▷ Concrete classes4595.74%
▷ Final classes00.00%
Methods1,211
▷ Static methods18315.11%
▷ Public methods85170.27%
▷ Protected methods161.32%
▷ Private methods34428.41%
Functions94
▷ Named functions9398.94%
▷ Anonymous functions11.06%
Constants130
▷ Global constants9875.38%
▷ Class constants3224.62%
▷ Public constants32100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.08MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/wp-sdk/assets/img/mobile-pages.png3.12KB2.85KB▼ 8.43%
src/ipad-frame.png25.80KB26.30KB0.00%
src/iphone-frame.png34.14KB34.92KB0.00%
src/wp-sdk/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
src/wp-sdk/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%