10% currencyr

Code Review | Currencyr

WordPress plugin Currencyr scored 10% from 54 tests.

About plugin

  • Plugin page: currencyr
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.3
  • WordPress version: 6.3.1
  • First release: Dec 17, 2012
  • Latest release: Jan 4, 2013
  • Number of updates: 34
  • Update frequency: every 0.5 days
  • Top authors: firmanw (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

200+ active / 15,552 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/currencyr/libs/class-currencyr.php+101
    Function create_function() is deprecated

Server metrics [RAM: ▼1.94MB] [CPU: ▼50.97ms] Passed 4 tests

Server-side resources used by Currencyr
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.05 ▼1.415.12 ▼36.18
Dashboard /wp-admin2.07 ▼1.245.93 ▼41.56
Posts /wp-admin/edit.php2.07 ▼1.297.98 ▼38.75
Add New Post /wp-admin/post-new.php2.07 ▼3.826.53 ▼87.39
Media Library /wp-admin/upload.php2.07 ▼1.166.94 ▼26.61

Server storage [IO: ▲0.60MB] [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: 33 new files
Database: 1 new table, 8 new options
New tables
wp_currencyr
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_currencyr
currencyr_db_version
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Currencyr
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,160 ▲42514.31 ▼0.3314.19 ▲12.3958.10 ▲10.28
Dashboard /wp-admin2,226 ▲384.85 ▼1.04104.34 ▼10.4242.82 ▼4.17
Posts /wp-admin/edit.php2,106 ▲172.05 ▲0.0234.15 ▼2.0134.07 ▼5.44
Add New Post /wp-admin/post-new.php1,624 ▲8218.14 ▼0.08660.53 ▲30.7456.59 ▼3.41
Media Library /wp-admin/upload.php1,408 ▲174.23 ▼0.0895.07 ▼5.6944.58 ▼2.22

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/currencyr/libs/class-currencyr.php+101
    Function create_function() is deprecated
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_currencyr
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

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
Even though no errors were found, this is by no means an exhaustive test

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 take a closer look at the following
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/currencyr/currencyr.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Currencyr_Provider' not found in wp-content/plugins/currencyr/libs/class-currencyr-provider-google.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Currencyr_Provider' not found in wp-content/plugins/currencyr/libs/class-currencyr-provider-foxrate.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Currencyr_Provider' not found in wp-content/plugins/currencyr/libs/class-currencyr-provider-yahoo.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Currencyr_Provider' not found in wp-content/plugins/currencyr/libs/class-currencyr-provider-ecb.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/currencyr/libs/class-currencyr-widget.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Currencyr_Provider' not found in wp-content/plugins/currencyr/libs/class-currencyr-provider-openexchangerates.php:22
    • > PHP Warning
      Use of undefined constant CURRENCYR_LIBS - assumed 'CURRENCYR_LIBS' (this will throw an Error in a future version of PHP) in wp-content/plugins/currencyr/libs/class-currencyr.php on line 15
    • > PHP Fatal error
      require_once(): Failed opening required 'CURRENCYR_LIBS/abstract-currencyr-provider.php' (include_path='.:/usr/share/php') in wp-content/plugins/currencyr/libs/class-currencyr.php on line 15
    • > PHP Warning
      require_once(CURRENCYR_LIBS/abstract-currencyr-provider.php): failed to open stream: No such file or directory in wp-content/plugins/currencyr/libs/class-currencyr.php on line 15

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Converter tooltip), #2 (The settings page), #3 (The widget)
The official readme.txt is a good inspiration

currencyr/currencyr.php 92% from 13 tests

The primary PHP file in "Currencyr" version 1.0.4 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 343 characters long)

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Almost there! Just fix the following issues
  • Do not distribute dangerous files with your plugin
    • .bin - Binary Executable in Windows, macOS, Linux
      • wp-content/plugins/currencyr/libs/ip2c/ip-to-country.bin
2,952 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP122887852,428
CSS3739289
JavaScript42570146
PO File1354289

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity19.30
▷ Minimum class complexity4.00
▷ Maximum class complexity83.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes110.00%
▷ Concrete classes990.00%
▷ Final classes00.00%
Methods82
▷ Static methods1214.63%
▷ Public methods6680.49%
▷ Protected methods1619.51%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants746.67%
▷ Class constants853.33%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/menuicon-sprite-2x.png4.08KB2.51KB▼ 38.47%
assets/images/menuicon-sprite.png1.56KB1.43KB▼ 7.97%
assets/images/pageicon32-2x.png4.40KB3.10KB▼ 29.59%
assets/css/themes/light/sprite.png1.71KB0.71KB▼ 58.65%
assets/images/pageicon32.png1.83KB1.64KB▼ 10.49%