10% mobpress

Code Review | MobPress

WordPress plugin MobPress scored10%from 54 tests.

About plugin

  • Plugin page: mobpress
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.3
  • WordPress version: 6.3.1
  • First release: Dec 25, 2017
  • Latest release: Dec 29, 2017
  • Number of updates: 12
  • Update frequency: every 0.6 days
  • Top authors: mobpress (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /855 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/mobpress/models/post.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; WPSDK_Post has a deprecated constructor

Server metrics [RAM: ▼1.69MB] [CPU: ▼57.17ms] Passed 4 tests

A check of server-side resources used by MobPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.31 ▼1.156.19 ▼34.21
Dashboard /wp-admin2.33 ▼1.027.19 ▼58.96
Posts /wp-admin/edit.php2.33 ▼1.037.48 ▼45.85
Add New Post /wp-admin/post-new.php2.33 ▼3.566.85 ▼89.65
Media Library /wp-admin/upload.php2.33 ▼0.908.87 ▼22.41
MobPress /wp-admin/options-general.php?page=wpsdk2.338.16

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 44 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

MobPress: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.71 ▼0.591.64 ▼0.1539.61 ▼3.61
Dashboard /wp-admin2,210 ▲345.81 ▼0.0496.84 ▼25.1739.80 ▼9.43
Posts /wp-admin/edit.php2,093 ▼02.04 ▼0.0239.33 ▼5.6934.78 ▼3.62
Add New Post /wp-admin/post-new.php1,536 ▲2223.37 ▲5.82654.58 ▲63.7556.02 ▲2.93
Media Library /wp-admin/upload.php1,392 ▲44.20 ▲0.0197.53 ▼2.0646.25 ▲3.13
MobPress /wp-admin/options-general.php?page=wpsdk6781.146.8020.09

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/mobpress/models/post.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; WPSDK_Post has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

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
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=wpsdk
    • > Deprecated in wp-content/plugins/mobpress/models/post.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; WPSDK_Post has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=wpsdk
    • > Deprecated in wp-content/plugins/mobpress/models/comment.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; WPSDK_Comment has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=wpsdk
    • > Deprecated in wp-content/plugins/mobpress/models/category.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; WPSDK_Category has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=wpsdk
    • > Deprecated in wp-content/plugins/mobpress/models/tag.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; WPSDK_Tag has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=wpsdk
    • > Deprecated in wp-content/plugins/mobpress/models/author.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; WPSDK_Author has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=wpsdk
    • > Deprecated in wp-content/plugins/mobpress/models/attachment.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; WPSDK_Attachment has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=wpsdk
    • > User deprecated in wp-includes/class-requests.php+24
    The PSR-0 `Requests_...` class names in the Requests library are deprecated. Switch to the PSR-4 `WpOrg\Requests\...` class names at your earliest convenience.
    • > GET request to /wp-admin/options-general.php?page=wpsdk
    • > Error in wp-includes/Requests/src/Transport/Curl.php+490
    Uncaught WpOrg\Requests\Exception: cURL error 6: Could not resolve host: mscq.service.mob.com in wp-includes/Requests/src/Transport/Curl.php:490
    Stack trace:
    #0 wp-includes/Requests/src/Transport/Curl.php(219): WpOrg\Requests\Transport\Curl->process_response()
    #1 wp-includes/Requests/src/Requests.php(469): WpOrg\Requests\Transport\Curl->request()
    #2 wp-includes/Requests/src/Requests.php(342): WpOrg\Requests\Requests::request()
    #3 wp-content/plugins/mobpress/singletons/api.php(382): WpOrg\Requests\Requests::post()
    #4 wp-content/plugins/mobpress/singletons/api.php(335): WPSDK->send_to_mob()
    #5 wp-content/plugins/mobpress/singletons/api.php(90): WPSDK->get_banners()
    #6 wp-includes/class-wp-hook.php(310): WPSDK->admin_options()
    #7 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #8 wp-includes/plugin.php(517): WP_H

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mobpress/json-api.php:79

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Screenshot #1 (JSON 格式) image missing
Please take inspiration from this readme.txt

mobpress/json-api.php 85% from 13 tests

Analyzing the main PHP file in "MobPress" version 1.0.0
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("mobpress.php" instead of "json-api.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 153 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin3,502 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP40339843,502

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity25.64
▷ Minimum class complexity2.00
▷ Maximum class complexity77.00
Average method complexity3.76
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods125
▷ Static methods00.00%
▷ Public methods11894.40%
▷ Protected methods75.60%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png22.90KB8.29KB▼ 63.82%