66% dokme

Code Review | دکمه، شبکه اجتماعی خرید

WordPress plugin دکمه، شبکه اجتماعی خرید scored66%from 54 tests.

About plugin

  • Plugin page: dokme
  • Plugin version: 2.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.4
  • WordPress version: 6.3.1
  • First release: Mar 7, 2018
  • Latest release: Jun 2, 2018
  • Number of updates: 11
  • Update frequency: every 11.9 days
  • Top authors: alirezamohammadi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,246 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼4.51ms] Passed 4 tests

Server-side resources used by دکمه، شبکه اجتماعی خرید
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1442.03 ▼6.72
Dashboard /wp-admin3.53 ▲0.2256.35 ▲1.80
Posts /wp-admin/edit.php3.58 ▲0.2358.71 ▲7.68
Add New Post /wp-admin/post-new.php6.05 ▲0.1687.31 ▼12.62
Media Library /wp-admin/upload.php3.37 ▲0.1437.31 ▼0.51
دکمه /wp-admin/admin.php?page=dokme-settings3.3733.95
کالاها /wp-admin/admin.php?page=dokme-products3.3735.91
دسته‌بندی‌ها /wp-admin/admin.php?page=dokme-category3.3637.61

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 22 new files
Database: 2 new tables, 6 new options
New tables
wp_dokme_synchronize
wp_dokme_sync
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for دکمه، شبکه اجتماعی خرید
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,963 ▲20214.83 ▲0.482.35 ▲0.2542.63 ▼1.35
Dashboard /wp-admin2,369 ▲1926.16 ▲0.48114.29 ▲23.5493.69 ▲54.06
Posts /wp-admin/edit.php2,294 ▲1943.34 ▲1.3347.50 ▲6.3783.92 ▲42.97
Add New Post /wp-admin/post-new.php1,561 ▲3323.12 ▲0.29660.16 ▲26.53155.87 ▲102.06
Media Library /wp-admin/upload.php1,440 ▲404.10 ▼0.1585.40 ▼20.7190.99 ▲46.06
دکمه /wp-admin/admin.php?page=dokme-settings1,1703.0141.1883.80
کالاها /wp-admin/admin.php?page=dokme-products1,1803.0040.3871.23
دسته‌بندی‌ها /wp-admin/admin.php?page=dokme-category1,0162.9540.1265.37

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=dokme-settings
    • > Notice in wp-content/plugins/dokme/includes/view.php+3
    Undefined property: stdClass::$publish

SRP 0% 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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/dokme/api.php
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/dokme/includes/dokme_productsList.php on line 2
    • > 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/dokme/includes/dokme_productsList.php on line 2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/dokme/includes/dokme_productsList.php on line 2
    • > 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/dokme/includes/dokme_productsList.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_count_posts() in wp-content/plugins/dokme/includes/view.php:2
    • > 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/dokme/includes/dokme_productsList.php on line 2
    • > 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/dokme/includes/dokme_productsList.php on line 2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=dokme-settings
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=dokme-settings 154:24 Uncaught SyntaxError: Unexpected token ';'
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dokme-category
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $ is not a function" "TypeError: $ is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/dokme/assets/js/dokme_ajax.js?h=f05f4&ver=6.3.1:35:5)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dokme-category
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $ is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (screenshot-1.png), #2 (screenshot-2.png)
  • Contributors: Plugin contributors not specified
You can take inspiration from this readme.txt

dokme/dokme.php 92% from 13 tests

"دکمه، شبکه اجتماعی خرید" version 2.0.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

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
There were no executable files found in this plugin1,250 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP11216811,028
JavaScript1153151
CSS112658
SQL21011
Markdown1002

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity12.29
▷ Minimum class complexity3.00
▷ Maximum class complexity21.00
Average method complexity2.41
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods56
▷ Static methods3358.93%
▷ Public methods5394.64%
▷ Protected methods35.36%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo.png4.81KB1.34KB▼ 72.19%