78% mazi-rest-apis

Code Review | Mazi REST APIs - Provides REST APIs getway with your WordPress site

WordPress plugin Mazi REST APIs - Provides REST APIs getway with your WordPress site scored 78% from 54 tests.

About plugin

  • Plugin page: mazi-rest-apis
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.4
  • WordPress version: 6.3.1
  • First release: Jul 12, 2020
  • Latest release: Jul 12, 2020
  • Number of updates: 3
  • Update frequency: every 1.7 days
  • Top authors: passionui (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 373 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 gracefully, with no errors

Server metrics [RAM: ▼0.58MB] [CPU: ▼20.74ms] Passed 4 tests

An overview of server-side resources used by Mazi REST APIs - Provides REST APIs getway with your WordPress site
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0736.53 ▼5.66
Dashboard /wp-admin3.40 ▲0.1047.09 ▼8.35
Posts /wp-admin/edit.php3.51 ▲0.1646.46 ▼0.11
Add New Post /wp-admin/post-new.php3.31 ▼2.5838.64 ▼68.83
Media Library /wp-admin/upload.php3.32 ▲0.0937.75 ▲2.47
Mazi Options /wp-admin/options-general.php?page=mazi3.3433.01

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 40 new files
Database: no new tables, 21 new options
New WordPress options
mazi_installed
mazi_color_option
mazi_post_field_icon
mazi_app_android
mazi_post_field_color
widget_recent-posts
mazi_per_page
mazi_category_field_color
widget_recent-comments
theysaidso_admin_options
...

Browser metrics Passed 4 tests

A check of browser resources used by Mazi REST APIs - Provides REST APIs getway with your WordPress site
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲7413.34 ▼0.911.55 ▼0.4840.38 ▼8.12
Dashboard /wp-admin2,215 ▲305.88 ▲1.0096.99 ▼7.2239.77 ▼7.02
Posts /wp-admin/edit.php2,098 ▲92.05 ▼0.0035.73 ▼2.9131.45 ▼5.09
Add New Post /wp-admin/post-new.php1,545 ▲718.19 ▼4.98643.80 ▲37.3159.61 ▲0.52
Media Library /wp-admin/upload.php1,394 ▲124.26 ▲0.0399.65 ▲0.2941.91 ▼0.95
Mazi Options /wp-admin/options-general.php?page=mazi9231.6723.8926.32

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 21 options in the database
    • mazi_color
    • theysaidso_admin_options
    • mazi_post_field_image
    • mazi_per_page
    • mazi_category_field_image
    • mazi_app_android
    • widget_recent-comments
    • can_compress_scripts
    • mazi_installed
    • mazi_post_field_icon
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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 fix the following
  • 49× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant MAZI_PATH - assumed 'MAZI_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/mazi-rest-apis/controllers/class-mazi-post-controller.php on line 2
    • > PHP Warning
      include_once(): Failed opening 'MAZI_PATH/models/class-mazi-post-model.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/mazi-rest-apis/controllers/class-mazi-wishlist-controller.php on line 2
    • > PHP Warning
      include_once(): Failed opening 'MAZI_PATH/models/class-mazi-setting-model.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/mazi-rest-apis/controllers/class-mazi-post-controller.php on line 4
    • > PHP Warning
      include_once(MAZI_PATH/models/class-mazi-user-model.php): failed to open stream: No such file or directory in wp-content/plugins/mazi-rest-apis/controllers/class-mazi-auth-controller.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/mazi-rest-apis/views/metadata/category-edit.php:3
    • > PHP Warning
      include_once(MAZI_PATH/models/class-mazi-category-model.php): failed to open stream: No such file or directory in wp-content/plugins/mazi-rest-apis/controllers/class-mazi-setting-controller.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/mazi-rest-apis/views/setting/option.php:8
    • > PHP Warning
      include_once(): Failed opening 'MAZI_PATH/models/class-mazi-post-model.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/mazi-rest-apis/controllers/class-mazi-post-controller.php on line 2
    • > PHP Warning
      include_once(MAZI_PATH/models/class-mazi-setting-model.php): failed to open stream: No such file or directory in wp-content/plugins/mazi-rest-apis/controllers/class-mazi-admin-setting-controller.php on line 2
    • > PHP Warning
      include_once(MAZI_PATH/models/class-mazi-setting-model.php): failed to open stream: No such file or directory in wp-content/plugins/mazi-rest-apis/controllers/class-mazi-setting-controller.php on line 4

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=mazi
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).wpColorPicker is not a function" "TypeError: $(...).wpColorPicker is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/mazi-rest-apis/assets/js/admin.js?ver=1.0.0:4:27)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&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&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=mazi
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).wpColorPicker is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: mobible news api, api, news api

mazi-rest-apis/mazi.php 85% from 13 tests

The main file in "Mazi REST APIs - Provides REST APIs getway with your WordPress site" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("mazi-rest-apis.php" instead of "mazi.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin9,693 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
CSS153,541657,929
PHP192437441,450
PO File18594200
JavaScript23035114

PHP code Passed 2 tests

This is a very shot 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.44
Average class complexity9.53
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods68
▷ Static methods3247.06%
▷ Public methods68100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions555.56%
▷ Anonymous functions444.44%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin