84% ashuwp-invitaion-code

Code Review | Ashuwp invitaion code

WordPress plugin Ashuwp invitaion code scored 84% from 54 tests.

About plugin

  • Plugin page: ashuwp-invitaion-...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.9
  • WordPress version: 6.3.1
  • First release: Aug 18, 2017
  • Latest release: Mar 12, 2018
  • Number of updates: 12
  • Update frequency: every 17.2 days
  • Top authors: ashuwp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active / 6,815 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.63ms] Passed 4 tests

This is a short check of server-side resources used by Ashuwp invitaion code
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.33 ▼9.28
Dashboard /wp-admin3.34 ▲0.0455.13 ▼2.90
Posts /wp-admin/edit.php3.39 ▲0.0452.23 ▼4.65
Add New Post /wp-admin/post-new.php5.92 ▲0.04125.64 ▲33.67
Media Library /wp-admin/upload.php3.26 ▲0.0442.53 ▲6.32
Add New /wp-admin/admin.php?page=invitation_code_add3.2330.97
Options /wp-admin/admin.php?page=invitation_code_options3.2334.79
Invitation Codes /wp-admin/admin.php?page=invitation_code3.2437.07

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 15 new files
Database: 1 new table, 7 new options
New tables
wp_ashuwp_invitation_code
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
ashuwp_invitation_code_version
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Ashuwp invitaion code
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,909 ▲10913.29 ▲0.134.82 ▲2.4841.64 ▼49.94
Dashboard /wp-admin2,312 ▲1065.84 ▲0.01100.47 ▲2.1241.40 ▼0.25
Posts /wp-admin/edit.php2,118 ▲291.99 ▼0.0537.08 ▼1.8136.28 ▲1.63
Add New Post /wp-admin/post-new.php1,538 ▲523.30 ▲0.07647.21 ▲46.6854.05 ▼6.78
Media Library /wp-admin/upload.php1,417 ▲294.23 ▲0.0296.86 ▼14.2442.00 ▼3.30
Add New /wp-admin/admin.php?page=invitation_code_add8982.0723.6330.90
Options /wp-admin/admin.php?page=invitation_code_options8392.2124.3832.07
Invitation Codes /wp-admin/admin.php?page=invitation_code1,0501.7225.8327.88

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ashuwp-invitaion-code/includes/invitation_code_login.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ashuwp-invitaion-code/admin/admin.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/ashuwp-invitaion-code/admin/admin.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ashuwp-invitaion-code/ashuwp_invitation_code.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ashuwp-invitaion-code/tinymce/insert_invitation_code.php:6
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/ashuwp-invitaion-code/admin/admin.php on line 4

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 96% from 29 tests

readme.txt Passed 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
2 plugin tags: register, invitation code

ashuwp-invitaion-code/ashuwp_invitation_code.php 92% from 13 tests

The entry point to "Ashuwp invitaion code" version 1.2 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ashuwp-invitaion-code.php" instead of "ashuwp_invitation_code.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin1,569 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP5219441,105
CSS150249
PO File14856112
JavaScript1251103

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity32.00
▷ Minimum class complexity9.00
▷ Maximum class complexity60.00
Average method complexity4.88
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods24
▷ Static methods28.33%
▷ Public methods2083.33%
▷ Protected methods00.00%
▷ Private methods416.67%
Functions26
▷ Named functions2492.31%
▷ Anonymous functions27.69%
Constants1
▷ Global constants1100.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
4 PNG files occupy 0.29MB with 0.18MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot/screenshot_04.png87.36KB31.54KB▼ 63.90%
screenshot/screenshot_01.png120.31KB45.77KB▼ 61.96%
screenshot/screenshot_02.png34.99KB13.32KB▼ 61.93%
screenshot/screenshot_03.png53.92KB20.85KB▼ 61.32%