10% external-database-based-actions

Code Review | External Database Based Actions

WordPress plugin External Database Based Actions scored 10% from 54 tests.

About plugin

  • Plugin page: external-database...
  • Plugin version: 0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 5.8.1
  • First release: Dec 12, 2017
  • Latest release: Jan 4, 2018
  • Number of updates: 9
  • Update frequency: every 2.7 days
  • Top authors: cmorillas1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,004 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/external-database-based-actions/lib/edba-frontend.php+8
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.17MB] [CPU: ▼137.03ms] Passed 4 tests

A check of server-side resources used by External Database Based Actions
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.0832.11 ▲0.15
Dashboard /wp-admin3.26 ▲0.2054.34 ▲8.59
Posts /wp-admin/edit.php3.34 ▲0.2345.69 ▲4.08
Add New Post /wp-admin/post-new.php5.62 ▲0.1986.36 ▼551.63
Media Library /wp-admin/upload.php3.20 ▲0.1934.86 ▼0.70
EDBA plugin /wp-admin/options-general.php?page=edba_admin_page3.0825.45

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 704 new files
Database: no new tables, 3 new options
New WordPress options
edba_settings_query
edba_settings_database
edba_settings_action

Browser metrics Passed 4 tests

Checking browser requirements for External Database Based Actions
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,266 ▼33015.65 ▲0.130.41 ▼7.708.39 ▼38.16
Dashboard /wp-admin2,978 ▲446.09 ▲0.14137.83 ▼3.28105.76 ▼1.99
Posts /wp-admin/edit.php2,744 ▲52.69 ▲0.0166.32 ▼1.0285.78 ▼3.64
Add New Post /wp-admin/post-new.php1,675 ▲17518.79 ▲0.28358.86 ▼10.78110.29 ▼5.09
Media Library /wp-admin/upload.php1,815 ▲84.95 ▼0.06150.16 ▼11.61120.80 ▲0.83
EDBA plugin /wp-admin/options-general.php?page=edba_admin_page1,2202.1058.8390.33

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/external-database-based-actions/lib/edba-installer.php+72
    rmdir(wp-content/uploads/edba_uploads): Directory not empty

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=edba_admin_page
    • > Notice in wp-content/plugins/external-database-based-actions/lib/edba-scripts.php+33
    Undefined index: tab

SRP 0% 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
  • 18× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/external-database-based-actions/lib/edba-frontend.php
    • > /wp-content/plugins/external-database-based-actions/lib/edba-admin-ajax-controller.php
    • > /wp-content/plugins/external-database-based-actions/assets/google-api-php-client-2.2.0/examples/simple-query.php
    • > /wp-content/plugins/external-database-based-actions/lib/edba-frontend-ajax-controller.php
    • > /wp-content/plugins/external-database-based-actions/assets/google-api-php-client-2.2.0/examples/batch.php
    • > /wp-content/plugins/external-database-based-actions/lib/edba-installer.php
    • > /wp-content/plugins/external-database-based-actions/assets/google-api-php-client-2.2.0/examples/test.php
    • > /wp-content/plugins/external-database-based-actions/lib/edba-admin.php
    • > /wp-content/plugins/external-database-based-actions/external-database-based-actions.php
    • > /wp-content/plugins/external-database-based-actions/lib/edba-functions.php
  • 402× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/external-database-based-actions/assets/google-api-php-client-2.2.0/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Auth\\tests\\BaseTest' not found in wp-content/plugins/external-database-based-actions/assets/google-api-php-client-2.2.0/vendor/google/auth/tests/FetchAuthTokenTest.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/external-database-based-actions/assets/google-api-php-client-2.2.0/vendor/monolog/monolog/tests/Monolog/Handler/RavenHandlerTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/external-database-based-actions/assets/google-api-php-client-2.2.0/vendor/google/apiclient-services/src/Google/Service/Sheets/BandedRange.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/external-database-based-actions/assets/google-api-php-client-2.2.0/vendor/guzzlehttp/promises/src/AggregateException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/external-database-based-actions/assets/google-api-php-client-2.2.0/vendor/google/apiclient-services/src/Google/Service/Sheets/PivotTable.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/external-database-based-actions/assets/google-api-php-client-2.2.0/vendor/monolog/monolog/tests/Monolog/Handler/HipChatHandlerTest.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/external-database-based-actions/assets/google-api-php-client-2.2.0/vendor/monolog/monolog/tests/Monolog/Processor/MercurialProcessorTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/external-database-based-actions/assets/google-api-php-client-2.2.0/vendor/google/apiclient-services/src/Google/Service/Sheets/CandlestickDomain.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/external-database-based-actions/assets/google-api-php-client-2.2.0/vendor/monolog/monolog/tests/Monolog/Handler/NewRelicHandlerTest.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: woocommerce coupon, google, actions, external, database...

external-database-based-actions/external-database-based-actions.php Passed 13 tests

"External Database Based Actions" version 0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
59 characters long description:
Do configurable actions conditioned by an external database

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin71,464 lines of code in 664 files:
LanguageFilesBlank linesComment linesLines of code
PHP5439,90830,75955,280
JavaScript632,4968099,700
Markdown291,39804,520
JSON17001,123
CSS48914592
XML430120
PO File1343484
YAML29036
make1409

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity11.28
▷ Minimum class complexity1.00
▷ Maximum class complexity592.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces38
Interfaces25
Traits5
Classes514
▷ Abstract classes101.95%
▷ Concrete classes50498.05%
▷ Final classes91.79%
Methods3,908
▷ Static methods1323.38%
▷ Public methods3,45688.43%
▷ Protected methods2045.22%
▷ Private methods2486.35%
Functions283
▷ Named functions11139.22%
▷ Anonymous functions17260.78%
Constants328
▷ Global constants288.54%
▷ Class constants30091.46%
▷ Public constants300100.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
There were not PNG files found in your plugin