83% mycred-githubreviews

Code Review | myCred Github Rewards

WordPress plugin myCred Github Rewards scored83%from 54 tests.

About plugin

  • Plugin page: mycred-githubreviews
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1.0+
  • WordPress version: 6.3.1
  • First release: Sep 14, 2020
  • Latest release: Nov 7, 2023
  • Number of updates: 28
  • Update frequency: every 41.1 days
  • Top authors: wpexpertsio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,620 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by myCred Github Rewards
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0435.88 ▼8.58
Dashboard /wp-admin3.34 ▲0.0451.90 ▲3.73
Posts /wp-admin/edit.php3.39 ▲0.0455.31 ▲5.12
Add New Post /wp-admin/post-new.php5.91 ▲0.0291.38 ▼0.94
Media Library /wp-admin/upload.php3.25 ▲0.0239.86 ▲5.78

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 172 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by myCred Github Rewards
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲3914.14 ▼0.211.65 ▼0.0137.82 ▼8.38
Dashboard /wp-admin2,203 ▲235.56 ▼0.1188.59 ▼6.4140.11 ▲0.59
Posts /wp-admin/edit.php2,114 ▲141.99 ▲0.0440.71 ▲1.3637.92 ▲0.43
Add New Post /wp-admin/post-new.php1,532 ▲623.45 ▲0.41726.24 ▲20.9068.03 ▲15.36
Media Library /wp-admin/upload.php1,408 ▲54.14 ▼0.0298.84 ▼0.8242.27 ▼2.19

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 21× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function read() on bool in wp-content/plugins/mycred-githubreviews/github-php-client/generate.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/mycred-githubreviews/admin/includes/templates/hooks/approved_pull_request_options_form.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/mycred-githubreviews/config.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/mycred-githubreviews/admin/includes/templates/github_settings_form.php:2
    • > PHP Fatal error
      Uncaught GitHubClientException: Page not defined in wp-content/plugins/mycred-githubreviews/github-php-client/client/GitHubClientBase.php:165
    • > PHP Fatal error
      Uncaught Error: Class 'myCRED_Module' not found in wp-content/plugins/mycred-githubreviews/admin/class-github-application-settings.php:3
    • > PHP Warning
      file_get_contents(wp-content/plugins/mycred-githubreviews/github-php-client/resources.rb): failed to open stream: No such file or directory in /var/www/wordpress/wp-content/plugins/mycred-githubreviews/github-php-client/generate.php on line 12
    • > PHP Warning
      Use of undefined constant MG_myCRED_GITHUB_TOKEN_URL - assumed 'MG_myCRED_GITHUB_TOKEN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/mycred-githubreviews/client/class-connect-client-with-github.php on line 156
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/mycred-githubreviews/client/class-connect-client-with-github.php:16
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/mycred-githubreviews/github-php-client/source/GitHubClient.php' (include_path='.:/usr/share/php') in wp-content/plugins/mycred-githubreviews/github-php-client/source/GithubService.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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
Attributes that need to be fixed:
  • Tested up to: Invalid plugin version format
You can look at the official readme.txt

mycred-githubreviews/mycred-github.php 85% from 13 tests

The main PHP file in "myCred Github Rewards" ver. 1.0.4 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("mycred-githubreviews.php" instead of "mycred-github.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 159 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin8,658 lines of code in 168 files:
LanguageFilesBlank linesComment linesLines of code
PHP1612,4824,4067,536
Markdown295301,048
JavaScript22134
CSS21132
JSON1008

PHP code Passed 2 tests

An short overview of 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.16
Average class complexity3.31
▷ Minimum class complexity1.00
▷ Maximum class complexity78.00
Average method complexity1.43
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes156
▷ Abstract classes21.28%
▷ Concrete classes15498.72%
▷ Final classes00.00%
Methods817
▷ Static methods101.22%
▷ Public methods71988.00%
▷ Protected methods9511.63%
▷ Private methods30.37%
Functions18
▷ Named functions1161.11%
▷ Anonymous functions738.89%
Constants34
▷ Global constants2058.82%
▷ Class constants1441.18%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin