68% serpwars-mobile-cta

Code Review | Serpwars Mobile CTA

WordPress plugin Serpwars Mobile CTA scored68%from 54 tests.

About plugin

  • Plugin page: serpwars-mobile-cta
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Feb 4, 2020
  • Latest release: Feb 4, 2020
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: serpwars (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /386 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.14MB] [CPU: ▼3.74ms] Passed 4 tests

Analyzing server-side resources used by Serpwars Mobile CTA
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1228.56 ▼12.87
Dashboard /wp-admin3.45 ▲0.1550.13 ▼1.66
Posts /wp-admin/edit.php3.56 ▲0.2152.71 ▲3.21
Add New Post /wp-admin/post-new.php6.03 ▲0.15103.50 ▲12.04
Media Library /wp-admin/upload.php3.37 ▲0.1539.80 ▼3.63
API /wp-admin/admin.php?page=ca_set_api_values3.3236.33
Buttons /wp-admin/admin.php?page=ca-mobile-elements3.3433.51
Add New /wp-admin/admin.php?page=ca_add_new_mobile_cta3.2524.35

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 65 new files
Database: 1 new table, 6 new options
New tables
wp_mobile_cta
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Serpwars Mobile CTA
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,946 ▲16014.22 ▼0.342.25 ▲0.1352.36 ▲7.65
Dashboard /wp-admin2,229 ▲585.59 ▲0.0890.58 ▼2.5839.50 ▼1.34
Posts /wp-admin/edit.php2,131 ▲282.02 ▼0.0139.39 ▼4.3535.56 ▼3.04
Add New Post /wp-admin/post-new.php6,274 ▲4,74618.79 ▼4.20922.58 ▲248.6455.07 ▲3.56
Media Library /wp-admin/upload.php1,434 ▲344.27 ▲0.0798.42 ▼5.6944.46 ▲2.97
API /wp-admin/admin.php?page=ca_set_api_values8192.0024.5024.29
Buttons /wp-admin/admin.php?page=ca-mobile-elements8571.9937.8727.79
Add New /wp-admin/admin.php?page=ca_add_new_mobile_cta9363.7163.6375.54

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
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_mobile_cta
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

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/admin.php?page=ca_set_api_values
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SERPWARS_API_Settings::me_options_page() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ca_set_api_values
    • > Notice in wp-content/plugins/serpwars-mobile-cta/includes/libs/mobile-elements.api_settings.class.php+49
    Trying to access array offset on value of type bool
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ca_add_new_mobile_cta
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)

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
Almost there! Just fix the following items
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/serpwars-mobile-cta/includes/mobile-element.class.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/serpwars-mobile-cta/frontend/main.php:6
    • > PHP Notice
      Undefined variable: container in wp-content/plugins/serpwars-mobile-cta/frontend/template/mobile-elements.tmpl.php on line 5
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/serpwars-mobile-cta/frontend/template/mobile-elements.tmpl.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/serpwars-mobile-cta/includes/mobile-elements.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/serpwars-mobile-cta/frontend/marketing-tools.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/serpwars-mobile-cta/main.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/serpwars-mobile-cta/includes/mobile-admin-class.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'FrontendHelper' not found in wp-content/plugins/serpwars-mobile-cta/frontend/template/mobile-elements.tmpl.php:10
    • > PHP Notice
      Trying to get property 'layout' of non-object in wp-content/plugins/serpwars-mobile-cta/frontend/template/mobile-elements.tmpl.php on line 5

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from), #2 (This is the second screen shot)
You can take inspiration from this readme.txt

serpwars-mobile-cta/main.php 92% from 13 tests

The primary PHP file in "Serpwars Mobile CTA" version 1.0.4 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("serpwars-mobile-cta.php" instead of "main.php")

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
Good job! No executable or dangerous file extensions detected18,969 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
SVG602417,917
PHP917229797
CSS72728194
JavaScript593161

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity7.29
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods49
▷ Static methods1632.65%
▷ Public methods49100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.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
3 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/rsz_serpwars-logo.663fba82.png6.67KB4.01KB▼ 39.85%
assets/img/jquery.minicolors.44ae4fdb.png67.02KB34.31KB▼ 48.80%
assets/img/27709270.a4c295ce.png5.74KB1.95KB▼ 66.07%