84% wpgetapi

Code Review | Connect to external APIs - WPGetAPI

WordPress plugin Connect to external APIs - WPGetAPI scored84%from 54 tests.

About plugin

  • Plugin page: wpgetapi
  • Plugin version: 2.2.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 1, 2021
  • Latest release: Oct 5, 2023
  • Number of updates: 213
  • Update frequency: every 3.3 days
  • Top authors: wpgetapi (100%)

Code review

54 tests

User reviews

21 reviews

Install metrics

5,000+ active /95,445 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.35MB] [CPU: ▲1.07ms] Passed 4 tests

This is a short check of server-side resources used by Connect to external APIs - WPGetAPI
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3555.46 ▲11.24
Dashboard /wp-admin3.65 ▲0.3557.18 ▲0.46
Posts /wp-admin/edit.php3.77 ▲0.4150.37 ▲0.65
Add New Post /wp-admin/post-new.php6.23 ▲0.3588.81 ▼4.34
Media Library /wp-admin/upload.php3.58 ▲0.3543.28 ▲7.52
Licenses /wp-admin/admin.php?page=wpgetapi_plugin_licenses3.8537.91
Setup /wp-admin/admin.php?page=wpgetapi_setup4.4543.44

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 394 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Connect to external APIs - WPGetAPI
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲6013.27 ▼1.321.84 ▼0.3342.27 ▼5.34
Dashboard /wp-admin2,252 ▲494.91 ▼0.05115.74 ▼41.2044.90 ▼1.41
Posts /wp-admin/edit.php2,139 ▲362.07 ▲0.1036.41 ▲0.2533.74 ▼2.46
Add New Post /wp-admin/post-new.php6,394 ▲4,86327.68 ▲4.68903.47 ▲226.0469.82 ▲18.78
Media Library /wp-admin/upload.php1,439 ▲454.22 ▼0.01110.74 ▲8.3346.74 ▲2.62
Licenses /wp-admin/admin.php?page=wpgetapi_plugin_licenses8461.8127.0124.54
Setup /wp-admin/admin.php?page=wpgetapi_setup1,1162.1135.3459.35

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 42× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/wpgetapi/lib/cmb2/includes/types/CMB2_Type_Wysiwyg.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wpgetapi/frontend/functions.php:171
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/wpgetapi/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpgetapi/lib/cmb2/example-functions.php:105
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Counter_Base' not found in wp-content/plugins/wpgetapi/lib/cmb2/includes/types/CMB2_Type_Text.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/wpgetapi/lib/cmb2/includes/types/CMB2_Type_File_List.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/wpgetapi/lib/cmb2/includes/types/CMB2_Type_Multi_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/wpgetapi/lib/cmb2/includes/types/CMB2_Type_File.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Multicheck' not found in wp-content/plugins/wpgetapi/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck_Hierarchical.php:13
    • > PHP Warning
      Use of undefined constant WPGETAPIVERSION - assumed 'WPGETAPIVERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/wpgetapi/includes/block-editor/index.asset.php on line 13

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% 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
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The Setup screen where you can add your external APIs), #2 (Once an external API has been added, a new page will be created to setup the API endpoints), #3 (A live demo of the output when debug mode is set to true), #4 (An example of some raw output from an API), #5 (Basic example of the output from an API formatted into HTML table)
The official readme.txt is a good inspiration

wpgetapi/wpgetapi.php Passed 13 tests

The entry point to "Connect to external APIs - WPGetAPI" version 2.2.3 is a PHP file that has certain tags in its header comment area
51 characters long description:
Connect to external API's and display the API data.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected57,266 lines of code in 235 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP682,8326,9519,125
JSON5006,644
CSS132691,1905,285
JavaScript94016201,721
Sass17306291,411
Markdown32450757

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity21.33
▷ Minimum class complexity1.00
▷ Maximum class complexity191.00
Average method complexity3.52
▷ Minimum method complexity1.00
▷ Maximum method complexity58.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes75
▷ Abstract classes912.00%
▷ Concrete classes6688.00%
▷ Final classes11.52%
Methods609
▷ Static methods9816.09%
▷ Public methods51183.91%
▷ Protected methods8914.61%
▷ Private methods91.48%
Functions45
▷ Named functions45100.00%
▷ Anonymous functions00.00%
Constants17
▷ Global constants1164.71%
▷ Class constants635.29%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
23 compressed PNG files occupy 1.42MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
lib/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
lib/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
lib/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
lib/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%