78% github-api

Code Review | GitHub API

WordPress plugin GitHub API scored78%from 54 tests.

About plugin

  • Plugin page: github-api
  • Plugin version: 0.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-3.9
  • WordPress version: 6.3.1
  • First release: Apr 10, 2014
  • Latest release: Apr 25, 2014
  • Number of updates: 7
  • Update frequency: every 2.4 days
  • Top authors: akeda (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,513 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.20MB] [CPU: ▼6.95ms] Passed 4 tests

A check of server-side resources used by GitHub API
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1842.35 ▼2.19
Dashboard /wp-admin3.52 ▲0.1755.16 ▼17.71
Posts /wp-admin/edit.php3.63 ▲0.2851.46 ▼4.85
Add New Post /wp-admin/post-new.php6.10 ▲0.2197.74 ▼3.03
Media Library /wp-admin/upload.php3.44 ▲0.2141.04 ▲3.87
GitHub API /wp-admin/options-general.php?page=wp_github_api3.42208.72
GitHub API /wp-admin/tools.php?page=wp_github_api_tools3.4234.94

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 17 new options
New WordPress options
wp_github_api_search_reset
wp_github_api_core_reset
wp_github_api_authenticated_user
wp_github_api_core_remaining
wp_github_api_search_remaining
wp_github_api_authorize_link
wp_github_api_authentication_method
wp_github_api_search_limit
theysaidso_admin_options
can_compress_scripts
...

Browser metrics Passed 4 tests

GitHub API: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.16 ▼0.221.86 ▲0.1043.58 ▲4.76
Dashboard /wp-admin2,203 ▲265.64 ▲0.1092.83 ▼4.4141.50 ▼0.57
Posts /wp-admin/edit.php2,108 ▲112.02 ▲0.0239.88 ▲1.3134.23 ▲0.04
Add New Post /wp-admin/post-new.php1,532 ▲123.06 ▼0.10642.08 ▼35.5260.41 ▲0.44
Media Library /wp-admin/upload.php1,408 ▲144.21 ▼0.03100.20 ▲4.7941.76 ▼2.76
GitHub API /wp-admin/options-general.php?page=wp_github_api8962.0128.2034.53
GitHub API /wp-admin/tools.php?page=wp_github_api_tools8302.0224.6128.74

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 17 options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • wp_github_api_authorize_link
    • wp_github_api_core_limit
    • wp_github_api_client_id
    • wp_github_api_search_limit
    • can_compress_scripts
    • wp_github_api_client_secret
    • wp_github_api_authentication_method
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=wp_github_api
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=wp_github_api
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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 items
  • 14× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/github-api/views/setting.php:2
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/github-api/views/tool_search_repositories.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/github-api/views/tool_weekly_commit_count.php:11
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/github-api/views/tool_get_repo_info.php on line 3
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/github-api/views/tool_get_org_info.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/github-api/views/tool.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/github-api/views/tool_get_org_info.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/github-api/github-api.php:31
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/github-api/views/tool_get_user_info.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/github-api/views/tool_get_user_info.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: Screenshot #1 (Tool as an example to render weekly commit count into a bar chart) image not found
  • Screenshots: Please add descriptions for these screenshots #2, #3, #4 in github-api/assets to your readme.txt
The official readme.txt is a good inspiration

github-api/github-api.php 92% from 13 tests

The main PHP script in "GitHub API" version 0.4.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

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
There were no executable files found in this plugin1,378 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP172284301,044
Bourne Again Shell24138152
Markdown340083
Bourne Shell112647
YAML15028
XML13024

PHP code Passed 2 tests

This is a short overview 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.29
Average class complexity12.56
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods54
▷ Static methods23.70%
▷ Public methods4990.74%
▷ Protected methods00.00%
▷ Private methods59.26%
Functions8
▷ Named functions00.00%
▷ Anonymous functions8100.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin