10% give-me-answer-lite

Code Review | Give Me Answer Lite

WordPress plugin Give Me Answer Lite scored10%from 54 tests.

About plugin

  • Plugin page: give-me-answer-lite
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.2.2
  • WordPress version: 6.3.1
  • First release: Aug 15, 2019
  • Latest release: Aug 15, 2019
  • Number of updates: 4
  • Update frequency: every 4.0 days
  • Top authors: siyavashebr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /900 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/give-me-answer-lite/includes/Libraries/Upload/class-upload.php+2727
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▲1.86MB] [CPU: ▼34.23ms] Passed 4 tests

Analyzing server-side resources used by Give Me Answer Lite
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.86 ▲2.3921.08 ▼18.20
Dashboard /wp-admin5.88 ▲2.5330.92 ▼25.06
Posts /wp-admin/edit.php5.88 ▲2.5222.87 ▼23.14
Add New Post /wp-admin/post-new.php5.88 ▼0.0122.21 ▼70.50
Media Library /wp-admin/upload.php5.88 ▲2.6527.07 ▼8.03
Settings /wp-admin/admin.php?page=gma-settings5.8826.94
Tags /wp-admin/edit-tags.php?taxonomy=gma-question_tag&post_type=gma-question5.8824.08
Categories /wp-admin/edit-tags.php?taxonomy=gma-question_category&post_type=gma-question5.8825.17
Answers /wp-admin/edit.php?post_type=gma-answer5.8828.17
Give Me Answer Lite /wp-admin/admin.php?page=give-me-answer-lite5.8822.67
Comments /wp-admin/admin.php?page=gma-comments5.8826.80
Add-Ons /wp-admin/admin.php?page=gma-addons5.8823.69
Questions /wp-admin/edit.php?post_type=gma-question5.8825.08

Server storage [IO: ▲7.51MB] [DB: ▲0.09MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 546 new files
Database: 1 new table, 22 new options
New tables
wp_gma_profile_visit
New WordPress options
gma-question_category_children
gma_permission
widget_gma_widget_category
can_compress_scripts
widget_gma-closed-question
widget_gma-top-responders
widget_recent-comments
gma_has_roles
widget_gma-latest-question
widget_gma-popular-question
...

Browser metrics Passed 4 tests

A check of browser resources used by Give Me Answer Lite
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,077 ▲33113.99 ▼0.3818.92 ▲17.2336.24 ▼6.54
Dashboard /wp-admin2,289 ▲1095.57 ▼0.1085.40 ▼9.0893.59 ▲56.60
Posts /wp-admin/edit.php2,191 ▲941.99 ▲0.0237.48 ▲0.6433.62 ▼7.35
Add New Post /wp-admin/post-new.php1,760 ▲22522.02 ▼3.12715.81 ▲64.1960.70 ▲0.18
Media Library /wp-admin/upload.php1,491 ▲944.17 ▼0.0498.95 ▼1.1894.33 ▲52.38
Settings /wp-admin/admin.php?page=gma-settings1,1162.6237.1330.83
Tags /wp-admin/edit-tags.php?taxonomy=gma-question_tag&post_type=gma-question1,4512.6443.6838.99
Categories /wp-admin/edit-tags.php?taxonomy=gma-question_category&post_type=gma-question1,5822.4738.2839.14
Answers /wp-admin/edit.php?post_type=gma-answer1,2092.7446.2835.23
Give Me Answer Lite /wp-admin/admin.php?page=give-me-answer-lite1,1462.8493.8735.61
Comments /wp-admin/admin.php?page=gma-comments1,3832.2033.4427.89
Add-Ons /wp-admin/admin.php?page=gma-addons9542.5734.2433.10
Questions /wp-admin/edit.php?post_type=gma-question1,3092.6339.3337.84

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/give-me-answer-lite/includes/Libraries/Upload/class-upload.php+2727
    Array and string offset access syntax with curly braces is deprecated
  • This plugin has failed uninstalling correctly, leaving 546 files (7.51MB) in the plugin directory
    • (new file) assets-admin/css/gma-admin-style-rtl.css
    • (new file) assets-admin/css/fontawesome.min.css
    • (new file) assets-admin/css/izimodal.min.css
    • (new file) assets-admin/css/izitoast.min.css
    • (new file) assets-admin/css/chosen.min.css
    • (new file) assets-admin/css/chart.min.css
    • (new file) assets-admin/css/index.php
    • (new file) README.md
    • (new file) assets-admin/css/gma-admin-style.css
    • (new file) assets-admin/css/nprogress.css
    • ...
  • Zombie WordPress options detected upon uninstall: 13 options
    • can_compress_scripts
    • db_upgraded
    • gma_plugin_activated
    • widget_gma_widget_category
    • widget_gma_widget_rss
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_gma-widget-ask-question
    • widget_recent-posts
    • widget_theysaidso_widget
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=gma-question
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/give-me-answer-lite/includes/Libraries/Upload/class-upload.php+2727
    Array and string offset access syntax with curly braces is deprecated

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 fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/give-me-answer-lite/templates/modal-share.php
  • 86× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post() in wp-content/plugins/give-me-answer-lite/templates/content-close.php:9
    • > PHP Notice
      Trying to get property 'roles' of non-object in wp-content/plugins/give-me-answer-lite/templates/user-summary.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/give-me-answer-lite/includes/Libraries/cmb2/includes/types/CMB2_Type_Taxonomy_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function absint() in wp-content/plugins/give-me-answer-lite/templates/profile/auth.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/give-me-answer-lite/includes/Widgets/class-widget-categories.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller' not found in wp-content/plugins/give-me-answer-lite/includes/Libraries/cmb2/includes/rest-api/CMB2_REST_Controller_Boxes.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/give-me-answer-lite/includes/Libraries/cmb2/includes/types/CMB2_Type_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post() in wp-content/plugins/give-me-answer-lite/templates/content-add-comment.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/give-me-answer-lite/includes/Libraries/cmb2/includes/types/CMB2_Type_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_field() in wp-content/plugins/give-me-answer-lite/templates/content-single-answer.php:16

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=give-me-answer-lite
    • > Console-api (warning) in unknown
    /wp-content/plugins/give-me-answer-lite/assets-admin/js/gma-dashboard.js?ver=6.3.1 64:12 Object

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Front-end appearance), #2 (Ask question page), #3 (Single question page), #4 (Dashboard), #5 (Show user info when hover on username), #6 (Share in socials), #7 (User profile page)
Please take inspiration from this readme.txt

give-me-answer-lite/give-me-answer-lite.php 85% from 13 tests

"Give Me Answer Lite" version 1.0'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:
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("languages/")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages/")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected87,953 lines of code in 353 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP1495,83511,57426,739
CSS265,0651,21619,482
SVG3003,895
JavaScript276505783,343
Sass16300251,378
Markdown52300640
HTML700153

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 574)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity32.23
▷ Minimum class complexity1.00
▷ Maximum class complexity826.00
Average method complexity4.36
▷ Minimum method complexity1.00
▷ Maximum method complexity574.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes128
▷ Abstract classes107.81%
▷ Concrete classes11892.19%
▷ Final classes00.00%
Methods1,184
▷ Static methods937.85%
▷ Public methods98182.85%
▷ Protected methods17414.70%
▷ Private methods292.45%
Functions324
▷ Named functions27283.95%
▷ Anonymous functions5216.05%
Constants69
▷ Global constants913.04%
▷ Class constants6086.96%
▷ Public constants60100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
31 PNG files occupy 1.00MB with 0.49MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets-admin/img/telegram.png1.04KB1.03KB▼ 0.75%
assets-admin/img/twitter.png12.91KB6.80KB▼ 47.33%
screenshot-7.png42.02KB14.13KB▼ 66.37%
screenshot-1.png127.82KB44.40KB▼ 65.26%
screenshot-4.png193.63KB64.71KB▼ 66.58%