10% scd-smart-currency-detector

Code Review | SCM - Smart Currency Manager

WordPress plugin SCM - Smart Currency Manager scored10%from 54 tests.

About plugin

  • Plugin page: scd-smart-currenc...
  • Plugin version: 4.7.10.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 11, 2017
  • Latest release: Sep 27, 2023
  • Number of updates: 338
  • Update frequency: every 6.4 days
  • Top authors: gajelabs1 (90.24%)scd2021 (10.06%)

Code review

54 tests

User reviews

11 reviews

Install metrics

100+ active /14,809 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > User deprecated in wp-includes/functions.php+5453
    Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead.

Server metrics [RAM: ▲0.78MB] [CPU: ▼2.80ms] Passed 4 tests

A check of server-side resources used by SCM - Smart Currency Manager
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.21 ▲0.7446.74 ▲6.50
Dashboard /wp-admin4.15 ▲0.8053.67 ▼4.66
Posts /wp-admin/edit.php4.20 ▲0.8453.88 ▲0.65
Add New Post /wp-admin/post-new.php6.67 ▲0.7885.60 ▼13.68
Media Library /wp-admin/upload.php4.01 ▲0.7842.26 ▲6.64

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 226 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
scd_first_install_date
scd_activation_notif_sent

Browser metrics Passed 4 tests

An overview of browser requirements for SCM - Smart Currency Manager
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲4614.36 ▼0.241.68 ▲0.1144.84 ▼0.55
Dashboard /wp-admin2,213 ▲365.50 ▼0.0483.45 ▼11.2541.47 ▼3.38
Posts /wp-admin/edit.php2,122 ▲222.04 ▲0.0535.70 ▼5.1933.82 ▼7.20
Add New Post /wp-admin/post-new.php1,539 ▲1323.24 ▲0.32620.87 ▲23.3548.49 ▼11.97
Media Library /wp-admin/upload.php1,415 ▲184.19 ▼0.04103.54 ▼0.8651.74 ▲9.41

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5453
    Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead.
  • Zombie WordPress options were found after uninstall: 9 options
    • widget_recent-comments
    • scd_deactivation_notif_sent
    • db_upgraded
    • widget_theysaidso_widget
    • scd_activation_notif_sent
    • theysaidso_admin_options
    • scd_first_install_date
    • can_compress_scripts
    • 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/scd-smart-currency-detector/scd_renders.php:986
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/scd-smart-currency-detector/index.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/scd-smart-currency-detector/scd_widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/scd-smart-currency-detector/scd_settings.php:426
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/scd-smart-currency-detector/templates/scd_widget.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/scd-smart-currency-detector/scd_inofs.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/scd-smart-currency-detector/templates/scd_vertical_flag.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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 need to be fixed: The official readme.txt is a good inspiration

scd-smart-currency-detector/index.php 85% from 13 tests

The main PHP file in "SCM - Smart Currency Manager" ver. 4.7.10.6 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("scd-smart-currency-detector.php" instead of "index.php")
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin15,895 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript171,1391,3138,546
PHP151,5671,0855,550
CSS6129451,591
JSON100179
Markdown116029

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions172
▷ Named functions17199.42%
▷ Anonymous functions10.58%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
177 PNG files occupy 0.56MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/chosen-sprite@2x.png0.85KB0.83KB▼ 3.10%
images/flags/AFN.png0.71KB0.32KB▼ 55.13%
images/flags/FJD.png0.84KB0.65KB▼ 23.17%
images/flags/ISK.png0.43KB0.24KB▼ 44.16%
images/scd_remove.png2.04KB1.55KB▼ 24.26%