83% one-termspolicy-page

Code Review | Persian Terms And Policy

WordPress plugin Persian Terms And Policy scored 83% from 54 tests.

About plugin

  • Plugin page: one-termspolicy-page
  • Plugin version: 0.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.2.4
  • WordPress version: 5.8.1
  • First release: Oct 30, 2019
  • Latest release: Nov 3, 2019
  • Number of updates: 5
  • Update frequency: every 0.8 days
  • Top authors: onemohsen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 488 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.38MB] [CPU: ▼131.60ms] Passed 4 tests

An overview of server-side resources used by Persian Terms And Policy
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.16 ▲0.4456.50 ▲33.32
Dashboard /wp-admin3.47 ▲0.4255.56 ▲10.75
Posts /wp-admin/edit.php3.51 ▲0.4154.17 ▲9.12
Add New Post /wp-admin/post-new.php5.77 ▲0.34104.58 ▼557.97
Media Library /wp-admin/upload.php3.35 ▲0.3544.61 ▲11.72
تنظیمات /wp-admin/edit.php?post_type=one-termspolicy_page&page=oneTermsPolicy_option3.3440.74
همه قوانین /wp-admin/edit.php?post_type=one-termspolicy_page3.4546.71
شرایط و قوانین سایت فروشگاهی /wp-admin/admin.php?page=oneTermsPolicy_StoreShop3.3445.92
حریم خصوصی /wp-admin/admin.php?page=oneTermsPolicy_Privacy3.3443.86
افزودن قوانین /wp-admin/post-new.php?post_type=one-termspolicy_page3.3039.41
تنظمیات اعتبارسنجی /wp-admin/admin.php?page=oneTermsPolicy_Validate_option3.3538.87
شرایط و قوانین سایت شخصی /wp-admin/admin.php?page=oneTermsPolicy_Personal3.3440.33
درباره افزونه /wp-admin/edit.php?post_type=one-termspolicy_page&page=oneTermsPolicy_info3.3339.98
شرایط و قوانین سایت شرکتی /wp-admin/admin.php?page=oneTermsPolicy_Company3.3439.34

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 53 new files
Database: no new tables, 4 new options
New WordPress options
_one-TermsPolicy_option
_one-TermsPolicy_Validate
recovery_mode_email_last_sent
_one-TermsPolicy_Activate

Browser metrics Passed 4 tests

Persian Terms And Policy: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,728 ▲13215.86 ▼0.188.30 ▼1.6948.88 ▼0.59
Dashboard /wp-admin3,015 ▲815.93 ▼0.11166.72 ▲10.95132.04 ▲14.71
Posts /wp-admin/edit.php2,784 ▲452.70 ▲0.0168.51 ▼11.46105.01 ▲0.97
Add New Post /wp-admin/post-new.php1,712 ▲2918.76 ▲0.21395.39 ▲10.73114.69 ▲2.84
Media Library /wp-admin/upload.php1,855 ▲485.04 ▲0.05185.97 ▲5.66142.91 ▲10.24
تنظیمات /wp-admin/edit.php?post_type=one-termspolicy_page&page=oneTermsPolicy_option1,2622.4064.4596.06
همه قوانین /wp-admin/edit.php?post_type=one-termspolicy_page1,4752.8966.36103.16
شرایط و قوانین سایت فروشگاهی /wp-admin/admin.php?page=oneTermsPolicy_StoreShop1,2842.0955.91113.38
حریم خصوصی /wp-admin/admin.php?page=oneTermsPolicy_Privacy9131.8536.2468.19
افزودن قوانین /wp-admin/post-new.php?post_type=one-termspolicy_page1,1692.5162.6097.86
تنظمیات اعتبارسنجی /wp-admin/admin.php?page=oneTermsPolicy_Validate_option1,2142.0554.17118.81
شرایط و قوانین سایت شخصی /wp-admin/admin.php?page=oneTermsPolicy_Personal1,2052.0653.31102.29
درباره افزونه /wp-admin/edit.php?post_type=one-termspolicy_page&page=oneTermsPolicy_info1,1492.3461.5789.47
شرایط و قوانین سایت شرکتی /wp-admin/admin.php?page=oneTermsPolicy_Company1,1972.0958.26104.28

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 1 option
    • recovery_mode_email_last_sent

Smoke tests 75% 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
    • > GET request to /wp-admin/admin.php?page=oneTermsPolicy_Privacy
    • > Error in wp-content/plugins/one-termspolicy-page/includes/pages/Page-Question.php+22
    Uncaught Error: Call to undefined method oneTermsPolicy\csQuestion::PrivacyQuestion() in wp-content/plugins/one-termspolicy-page/includes/pages/Page-Question.php:22
    Stack trace:
    #0 wp-content/plugins/one-termspolicy-page/includes/csMenu.php(96): include()
    #1 wp-includes/class-wp-hook.php(303): oneTermsPolicy\csMenu->privacy_Question_Content()
    #2 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(470): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > GET request to /wp-admin/post-new.php?post_type=one-termspolicy_page
    • > Notice in wp-includes/admin-bar.php+717
    Trying to get property 'post_type' of non-object

SRP Passed 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
Congratulations! This plugin passed the SRP test

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

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Tags: No tags were detected
The official readme.txt might help

one-termspolicy-page/oneTermsPolicy.php 85% from 13 tests

The main PHP file in "Persian Terms And Policy" ver. 0.1.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("one-termspolicy-page.php" instead of "oneTermsPolicy.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin4,867 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP302222603,000
CSS2389101,657
JavaScript3214173
PO File14425
JSON21012

PHP code Passed 2 tests

A short review 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.54
Average class complexity12.47
▷ Minimum class complexity1.00
▷ Maximum class complexity51.00
Average method complexity3.29
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods76
▷ Static methods79.21%
▷ Public methods7598.68%
▷ Protected methods00.00%
▷ Private methods11.32%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants15
▷ Global constants15100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected