58% card-oracle

Code Review | Tarot Card Oracle

WordPress plugin Tarot Card Oracle scored58%from 54 tests.

About plugin

  • Plugin page: card-oracle
  • Plugin version: 1.1.6
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2
  • WordPress version: 6.3.1
  • First release: May 8, 2020
  • Latest release: Jul 5, 2023
  • Number of updates: 44
  • Update frequency: every 26.3 days
  • Top authors: chillichalli (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /8,219 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲5.16MB] [CPU: ▲34.01ms] 75% from 4 tests

An overview of server-side resources used by Tarot Card Oracle
Please fix the following
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.16MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.87 ▲5.4167.30 ▲24.44
Dashboard /wp-admin8.89 ▲5.5984.85 ▲35.46
Posts /wp-admin/edit.php8.89 ▲5.5485.08 ▲36.81
Add New Post /wp-admin/post-new.php10.00 ▲4.12128.59 ▲40.51
Media Library /wp-admin/upload.php8.89 ▲5.6769.92 ▲39.34
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.8962.30

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 575 new files
Database: no new tables, 10 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
card_oracle_version
can_compress_scripts
fs_active_plugins
widget_recent-posts
fs_debug_mode
widget_recent-comments
fs_accounts

Browser metrics Passed 4 tests

Tarot Card Oracle: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,995 ▲23814.02 ▼0.367.26 ▲5.3029.38 ▼17.44
Dashboard /wp-admin2,284 ▲935.90 ▲1.01110.24 ▼9.0039.76 ▼7.13
Posts /wp-admin/edit.php2,174 ▲852.15 ▲0.1239.98 ▲4.3236.90 ▲2.86
Add New Post /wp-admin/post-new.php1,697 ▲17522.47 ▼0.83606.44 ▼32.2055.35 ▼2.60
Media Library /wp-admin/upload.php1,463 ▲784.16 ▲0.0494.32 ▼18.6543.03 ▼7.33
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1321.8526.1027.81

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/card-oracle/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 10 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • fs_debug_mode
    • card_oracle_version
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • fs_accounts
    • fs_active_plugins
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however 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
Almost there! Just fix the following items
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/card-oracle/admin/partials/card-oracle-admin-display.php
    • > /wp-content/plugins/card-oracle/admin/partials/card-oracle-admin-footer.php
    • > /wp-content/plugins/card-oracle/includes/stripe/build.php
    • > /wp-content/plugins/card-oracle/admin/partials/card-oracle-tab-general.php
    • > /wp-content/plugins/card-oracle/includes/stripe/update_certs.php
  • 210× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/card-oracle/includes/stripe/lib/Coupon.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractServiceFactory' not found in wp-content/plugins/card-oracle/includes/stripe/lib/Service/Issuing/IssuingServiceFactory.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/card-oracle/includes/stripe/lib/Service/TaxRateService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/card-oracle/includes/stripe/lib/Service/BillingPortal/SessionService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/card-oracle/includes/stripe/lib/Service/InvoiceItemService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractServiceFactory' not found in wp-content/plugins/card-oracle/includes/stripe/lib/Service/Identity/IdentityServiceFactory.php:13
    • > PHP Notice
      Undefined variable: active_tab in wp-content/plugins/card-oracle/admin/partials/card-oracle-tab-general.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\StripeObject' not found in wp-content/plugins/card-oracle/includes/stripe/lib/ApiResource.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/card-oracle/includes/stripe/lib/CreditNote.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/card-oracle/includes/stripe/lib/FileLink.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: cartouche cards, tarot readings, runes, tarot cards

card-oracle/card-oracle.php Passed 13 tests

The main PHP file in "Tarot Card Oracle" ver. 1.1.6 adds more information about the plugin and also serves as the entry point for this plugin
104 characters long description:
This plugin lets you create tarot and oracle readings using your own cards, spreads and interpretations.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Please make sure to remedy the following
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/card-oracle/includes/stripe/data/ca-certificates.crt
56,099 lines of code in 420 files:
LanguageFilesBlank linesComment linesLines of code
PHP37310,44328,79645,233
PO File62,5383,2585,214
JSON4002,549
CSS19247161,366
Markdown370301,166
JavaScript1196122511
XML10031
make18023
SVG1003
YAML1003

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please tend to the following items
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity18.66
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity3.45
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces24
Interfaces9
Traits7
Classes272
▷ Abstract classes124.41%
▷ Concrete classes26095.59%
▷ Final classes00.00%
Methods2,103
▷ Static methods36717.45%
▷ Public methods1,62077.03%
▷ Protected methods512.43%
▷ Private methods43220.54%
Functions146
▷ Named functions13491.78%
▷ Anonymous functions128.22%
Constants967
▷ Global constants15315.82%
▷ Class constants81484.18%
▷ Public constants814100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
13 PNG files occupy 2.57MB with 1.47MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/layouts/five_card_layout-2.png303.04KB103.87KB▼ 65.72%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/layouts/five_card_layout-1.png304.23KB104.04KB▼ 65.80%
assets/layouts/celtic_cross_layout.png322.90KB114.58KB▼ 64.52%