68% gatewayapi

Code Review | GatewayAPI

WordPress plugin GatewayAPI scored68%from 54 tests.

About plugin

  • Plugin page: gatewayapi
  • Plugin version: 1.8.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3.1
  • WordPress version: 6.3.1
  • First release: May 25, 2016
  • Latest release: Oct 11, 2023
  • Number of updates: 94
  • Update frequency: every 28.7 days
  • Top authors: onlinecity (85.11%)trojborg (15.96%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active /17,535 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.25MB] [CPU: ▲0.16ms] Passed 4 tests

Server-side resources used by GatewayAPI
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2547.65 ▲5.12
Dashboard /wp-admin3.56 ▲0.2556.69 ▲1.64
Posts /wp-admin/edit.php3.67 ▲0.3152.71 ▲1.58
Add New Post /wp-admin/post-new.php6.14 ▲0.2595.79 ▼7.69
Media Library /wp-admin/upload.php3.48 ▲0.2543.00 ▲7.28
GatewayAPI Settings /wp-admin/options-general.php?page=gatewayapi3.7341.00

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 130 new files
Database: 1 new table, 7 new options
New tables
wp_oc_recipients_import
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
gatewayapi_db_version
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

GatewayAPI: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.25 ▼0.321.96 ▲0.1747.08 ▲4.96
Dashboard /wp-admin2,202 ▲255.57 ▼0.0291.72 ▼1.6238.39 ▼1.34
Posts /wp-admin/edit.php2,107 ▲41.99 ▼0.0338.20 ▲0.4133.84 ▼0.69
Add New Post /wp-admin/post-new.php1,531 ▲523.04 ▲0.04677.59 ▼51.1553.64 ▼11.02
Media Library /wp-admin/upload.php1,407 ▲44.21 ▲0.03105.14 ▼3.6746.46 ▼3.02
GatewayAPI Settings /wp-admin/options-general.php?page=gatewayapi5,0783.3787.0234.32

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

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

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gatewayapi
    • > Notice in wp-content/plugins/gatewayapi/tpl/settings_page.php+590
    Trying to get property 'name' of non-object
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gatewayapi
    • > Notice in wp-content/plugins/gatewayapi/tpl/settings_page.php+590
    Trying to get property 'term_id' of non-object

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
Please fix the following
  • 37× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/gatewayapi/inc/security_two_factor.php
    • > /wp-content/plugins/gatewayapi/tpl/notification/message.php
    • > /wp-content/plugins/gatewayapi/inc/triggers.php
    • > /wp-content/plugins/gatewayapi/inc/cpt_receive_sms_ui.php
    • > /wp-content/plugins/gatewayapi/inc/cpt_sms_editor_ui.php
    • > /wp-content/plugins/gatewayapi/inc/shortcode.php
    • > /wp-content/plugins/gatewayapi/src/classes/Trigger.php
    • > /wp-content/plugins/gatewayapi/src/classes/Notification.php
    • > /wp-content/plugins/gatewayapi/tpl/wp-login-confirmed-phone.php
    • > /wp-content/plugins/gatewayapi/inc/cpt_receive_sms.php

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 Passed 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
5 plugin tags: two factor, mobile, security, sms, texting

gatewayapi/gatewayapi.php Passed 13 tests

Analyzing the main PHP file in "GatewayAPI" version 1.8.3
35 characters long description:
Manage SMS broadcasts via WordPress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected22,714 lines of code in 126 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript733,0831,12512,365
PHP381,3609907,064
PO File15166141,502
CSS515215913
Markdown53210852
SVG30117
JSON1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity37.67
▷ Minimum class complexity1.00
▷ Maximum class complexity185.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods156
▷ Static methods4126.28%
▷ Public methods11674.36%
▷ Protected methods1710.90%
▷ Private methods2314.74%
Functions161
▷ Named functions7043.48%
▷ Anonymous functions9156.52%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin