10% myloyal

Code Review | myLoyal - reward, point, gamification and loyalty plugin with easy but smart yet rules

WordPress plugin myLoyal - reward, point, gamification and loyalty plugin with easy but smart yet rules scored 10% from 54 tests.

About plugin

  • Plugin page: myloyal
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8.1
  • WordPress version: 5.8.1
  • First release: Sep 10, 2021
  • Latest release: Sep 28, 2021
  • Number of updates: 7
  • Update frequency: every 2.6 days
  • Top authors: mithublue (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 89 total downloads

Benchmarks

Plugin footprint 23% 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
The following installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/myloyal/core/action-runner.php+49
    Invalid argument supplied for foreach()

Server metrics [RAM: ▼0.62MB] [CPU: ▼183.78ms] Passed 4 tests

An overview of server-side resources used by myLoyal - reward, point, gamification and loyalty plugin with easy but smart yet rules
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.01 ▲0.2912.24 ▼9.60
Dashboard /wp-admin3.03 ▼0.0213.08 ▼32.52
Posts /wp-admin/edit.php3.03 ▼0.0713.01 ▼31.86
Add New Post /wp-admin/post-new.php3.03 ▼2.4011.60 ▼643.17
Media Library /wp-admin/upload.php3.03 ▲0.0212.36 ▼27.58
Point Rule /wp-admin/admin.php?page=point_rules3.0320.28
Achievements /wp-admin/edit-tags.php?taxonomy=achievements&post_type=loyal_badge3.0313.53
Badge /wp-admin/edit.php?post_type=loyal_badge3.0312.89
myLoyal /wp-admin/admin.php?page=myloyal3.0312.56

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 290 new files
Database: 2 new tables, 1 new option
New tables
wp_myloyal_badge_user
wp_myloyal_log
New WordPress options
myloyal_pages

Browser metrics Passed 4 tests

An overview of browser requirements for myLoyal - reward, point, gamification and loyalty plugin with easy but smart yet rules
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,723 ▲12715.93 ▲0.0112.92 ▲2.4757.59 ▲10.23
Dashboard /wp-admin3,014 ▲836.04 ▲0.03131.00 ▼8.5398.83 ▼7.26
Posts /wp-admin/edit.php2,783 ▲442.72 ▲0.0264.95 ▼0.2397.06 ▲8.47
Add New Post /wp-admin/post-new.php1,632 ▲13418.60 ▼0.19362.50 ▼15.17107.93 ▼8.60
Media Library /wp-admin/upload.php1,851 ▲445.04 ▼0.01155.52 ▲11.02131.88 ▲6.26
Point Rule /wp-admin/admin.php?page=point_rules1,1873.2280.8667.35
Achievements /wp-admin/edit-tags.php?taxonomy=achievements&post_type=loyal_badge1,7822.3870.3493.26
Badge /wp-admin/edit.php?post_type=loyal_badge1,4812.7659.0267.34
myLoyal /wp-admin/admin.php?page=myloyal1,0352.0965.1361.68

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/myloyal/core/action-runner.php+49
    Invalid argument supplied for foreach()
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_myloyal_log
    • wp_myloyal_badge_user
  • Zombie WordPress options were found after uninstall: 1 option
    • myloyal_pages

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=myloyal
    • > Warning in wp-content/plugins/myloyal/core/action-runner.php+49
    Invalid argument supplied for foreach()

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
Please take a closer look at the following
  • 7× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/myloyal/vendor/as247/wp-eloquent/src/Pagination/resources/views/tailwind.blade.php
    • > /wp-content/plugins/myloyal/vendor/as247/wp-eloquent/src/Pagination/resources/views/simple-tailwind.blade.php
    • > /wp-content/plugins/myloyal/vendor/as247/wp-eloquent/src/Pagination/resources/views/simple-default.blade.php
    • > /wp-content/plugins/myloyal/vendor/as247/wp-eloquent/src/Pagination/resources/views/default.blade.php
    • > /wp-content/plugins/myloyal/vendor/as247/wp-eloquent/src/Pagination/resources/views/bootstrap-4.blade.php
    • > /wp-content/plugins/myloyal/vendor/as247/wp-eloquent/src/Pagination/resources/views/simple-bootstrap-4.blade.php
    • > /wp-content/plugins/myloyal/vendor/as247/wp-eloquent/src/Pagination/resources/views/semantic-ui.blade.php
  • 109× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'As247\\WpEloquent\\Database\\Connectors\\Connector' not found in wp-content/plugins/myloyal/vendor/as247/wp-eloquent/src/Database/Connectors/MySqlConnector.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'As247\\WpEloquent\\Doctrine\\Inflector\\WordInflector' not found in wp-content/plugins/myloyal/vendor/as247/wp-eloquent/src/Doctrine/Inflector/Rules/Transformations.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'As247\\WpEloquent\\Support\\Enumerable' not found in wp-content/plugins/myloyal/vendor/as247/wp-eloquent/src/Support/Collection.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'As247\\WpEloquent\\Database\\Eloquent\\Relations\\Relation' not found in wp-content/plugins/myloyal/vendor/as247/wp-eloquent/src/Database/Eloquent/Relations/HasOneOrMany.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'As247\\WpEloquent\\Contracts\\Support\\Arrayable' not found in wp-content/plugins/myloyal/vendor/as247/wp-eloquent/src/Database/Eloquent/Model.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'As247\\WpEloquent\\Database\\Grammar' not found in wp-content/plugins/myloyal/vendor/as247/wp-eloquent/src/Database/Schema/Grammars/Grammar.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'As247\\WpEloquent\\Database\\Connectors\\Connector' not found in wp-content/plugins/myloyal/vendor/as247/wp-eloquent/src/Database/Connectors/SQLiteConnector.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'As247\\WpEloquent\\Contracts\\Pagination\\Paginator' not found in wp-content/plugins/myloyal/vendor/as247/wp-eloquent/src/Contracts/Pagination/LengthAwarePaginator.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'As247\\WpEloquent\\Database\\Connectors\\Connector' not found in wp-content/plugins/myloyal/vendor/as247/wp-eloquent/src/Database/Connectors/SqlServerConnector.php:8
    • > PHP Fatal error
      Trait 'As247\\WpEloquent\\Support\\Traits\\ForwardsCalls' not found in wp-content/plugins/myloyal/vendor/as247/wp-eloquent/src/Database/Eloquent/Relations/Relation.php on line 17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: There are too many tags (15 tag instead of maximum 10)
Please take inspiration from this readme.txt

myloyal/myloyal.php Passed 13 tests

This is the main PHP file of "myLoyal - reward, point, gamification and loyalty plugin with easy but smart yet rules" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
84 characters long description:
Manage points, rewards, gamifications, ranks, badges on user activities on your site

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected51,049 lines of code in 284 files:
LanguageFilesBlank linesComment linesLines of code
PHP2616,91222,86025,316
JSON80012,621
JavaScript31,4311,88712,288
CSS11160362
Blade71826257
Sass130113
Markdown331092

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.34
Average class complexity11.04
▷ Minimum class complexity1.00
▷ Maximum class complexity157.00
Average method complexity1.77
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces42
Interfaces35
Traits24
Classes187
▷ Abstract classes147.49%
▷ Concrete classes17392.51%
▷ Final classes84.62%
Methods3,107
▷ Static methods2999.62%
▷ Public methods2,35075.64%
▷ Protected methods75024.14%
▷ Private methods70.23%
Functions313
▷ Named functions154.79%
▷ Anonymous functions29895.21%
Constants20
▷ Global constants945.00%
▷ Class constants1155.00%
▷ Public constants1090.91%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected