77% cryptocurrency-shortcodes

Code Review | Cryptocurrency Shortcodes

WordPress plugin Cryptocurrency Shortcodes scored 77% from 54 tests.

About plugin

  • Plugin page: cryptocurrency-sh...
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.0
  • WordPress version: 6.3.1
  • First release: Dec 20, 2018
  • Latest release: Jan 7, 2019
  • Number of updates: 25
  • Update frequency: every 0.7 days
  • Top authors: ryner1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 4,866 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▲1.71ms] Passed 4 tests

Analyzing server-side resources used by Cryptocurrency Shortcodes
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0745.31 ▲3.71
Dashboard /wp-admin3.35 ▲0.0453.55 ▲2.34
Posts /wp-admin/edit.php3.40 ▲0.0446.09 ▲1.28
Add New Post /wp-admin/post-new.php5.95 ▲0.0687.27 ▼0.48
Media Library /wp-admin/upload.php3.27 ▲0.0441.39 ▲10.44
Cryptocurrency Shortcodes /wp-admin/options-general.php?page=rynerg_rgcs3.3235.79

Server storage [IO: ▲0.33MB] [DB: ▲0.02MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
rynerg_rgcs_number_of_currencies_to_retrieve
rynerg_rgcs_refresh_json_content
rynerg_rgcs_api_crypto_json
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
rynerg_crypto_current_plugin_version
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cryptocurrency Shortcodes
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,951 ▲21613.72 ▼0.956.38 ▲4.5241.65 ▼11.76
Dashboard /wp-admin2,237 ▲495.00 ▼0.90120.66 ▲4.7441.67 ▲1.32
Posts /wp-admin/edit.php2,117 ▲282.09 ▲0.1041.88 ▲5.7933.57 ▼0.47
Add New Post /wp-admin/post-new.php1,540 ▲2623.21 ▲5.78674.90 ▲10.8060.59 ▲9.90
Media Library /wp-admin/upload.php1,419 ▲314.35 ▲0.04103.45 ▲0.1542.62 ▼2.32
Cryptocurrency Shortcodes /wp-admin/options-general.php?page=rynerg_rgcs1,2682.2048.0178.59

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 10 options in the database
    • rynerg_rgcs_api_crypto_json
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • rynerg_rgcs_number_of_currencies_to_retrieve
    • db_upgraded
    • rynerg_rgcs_refresh_json_content
    • widget_recent-comments
    • rynerg_crypto_current_plugin_version
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/cryptocurrency-shortcodes/my-admin/rgcs-template-tab-content-others.php
    • > /wp-content/plugins/cryptocurrency-shortcodes/my-admin/rgcs-template-tab-content-shortcode.php
    • > /wp-content/plugins/cryptocurrency-shortcodes/my-admin/rgcs-template-tab-content-screenshots.php
    • > /wp-content/plugins/cryptocurrency-shortcodes/my-admin/rgcs-template-tab-content-select.php
  • 13× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: num_retrieve in wp-content/plugins/cryptocurrency-shortcodes/my-admin/rgcs-template-tab-content-general.php on line 47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cryptocurrency-shortcodes/my-admin/rgcs-template-options-ajax.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cryptocurrency-shortcodes/my-admin/admin-return-html-templates/rg-shortcode-template-carousel.php:7
    • > PHP Warning
      Use of undefined constant rg__Plugin_LINK - assumed 'rg__Plugin_LINK' (this will throw an Error in a future version of PHP) in wp-content/plugins/cryptocurrency-shortcodes/my-admin/rgcs-template-tab-content-screenshots.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/cryptocurrency-shortcodes/my-admin/admin-return-html-templates/rg-shortcode-template.php:46
    • > PHP Notice
      Undefined variable: items in wp-content/plugins/cryptocurrency-shortcodes/my-admin/rgcs-template-tab-content-select.php on line 28
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/cryptocurrency-shortcodes/my-admin/rgcs-template-tab-content-select.php on line 28
    • > PHP Warning
      Use of undefined constant rg__Plugin_LINK - assumed 'rg__Plugin_LINK' (this will throw an Error in a future version of PHP) in wp-content/plugins/cryptocurrency-shortcodes/my-admin/rgcs-template-tab-content-screenshots.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cryptocurrency-shortcodes/my-admin/rgcs-template-tab-content-general.php:62
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cryptocurrency-shortcodes/my-admin/admin-return-html-templates/rg-shortcode-template-list.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (The first screenshot Carousel-Example.png displays the example for the Carousel Type of display) image missing
You can take inspiration from this readme.txt

cryptocurrency-shortcodes/functions.php 69% from 13 tests

The primary PHP file in "Cryptocurrency Shortcodes" version 0.2 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Domain Path: The domain path points to an invalid folder, "/lang" does not exist
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 172 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("cryptocurrency-shortcodes.php" instead of "functions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin2,580 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP152812831,229
JavaScript312626726
CSS24620624
JSON1001

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.31
Average class complexity9.50
▷ Minimum class complexity5.00
▷ Maximum class complexity14.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.22MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
my-images/List-Example.PNG25.14KB11.42KB▼ 54.59%
my-images/image1.PNG43.20KB17.25KB▼ 60.07%
my-images/image0.PNG43.94KB20.39KB▼ 53.59%
my-images/rgcs_crypto_logo.png38.24KB39.46KB0.00%
my-images/image2.PNG66.44KB32.45KB▼ 51.16%