10% embed-power-bi

Code Review | Power BI Embedded for WordPress

WordPress plugin Power BI Embedded for WordPress scored10%from 54 tests.

About plugin

  • Plugin page: embed-power-bi
  • Plugin version: 1.1.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Feb 22, 2018
  • Latest release: Jun 17, 2023
  • Number of updates: 35
  • Update frequency: every 55.5 days
  • Top authors: atlaspolicy (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /20,828 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/embed-power-bi/includes/class-power-bi-schedule-resources.php+37
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.60MB] [CPU: ▼49.22ms] Passed 4 tests

This is a short check of server-side resources used by Power BI Embedded for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.39 ▼1.086.23 ▼33.07
Dashboard /wp-admin2.41 ▼0.909.07 ▼39.80
Posts /wp-admin/edit.php2.41 ▼0.9511.95 ▼32.47
Add New Post /wp-admin/post-new.php2.41 ▼3.488.32 ▼91.54
Media Library /wp-admin/upload.php2.41 ▼0.8310.50 ▼23.46
Settings /wp-admin/edit.php?post_type=powerbi&page=powerbi2.419.65
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=powerbi2.419.26
All Power BI Items /wp-admin/edit.php?post_type=powerbi2.417.64
Add New /wp-admin/post-new.php?post_type=powerbi2.418.55

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 427 new files
Database: no new tables, 8 new options
New WordPress options
power_bi_credentials
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
category_children
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Power BI Embedded for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,947 ▲17614.11 ▼0.2611.19 ▲9.3636.82 ▼1.73
Dashboard /wp-admin2,255 ▲634.94 ▼0.02106.47 ▲1.6140.97 ▼2.70
Posts /wp-admin/edit.php2,135 ▲462.06 ▲0.0537.17 ▲3.8533.75 ▼0.94
Add New Post /wp-admin/post-new.php1,560 ▲3723.68 ▲0.66675.85 ▼38.5356.62 ▼4.20
Media Library /wp-admin/upload.php1,434 ▲464.31 ▲0.0794.11 ▼0.6940.94 ▼2.06
Settings /wp-admin/edit.php?post_type=powerbi&page=powerbi3,8352.1027.0229.16
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=powerbi1,4912.2229.9132.36
All Power BI Items /wp-admin/edit.php?post_type=powerbi1,1622.0032.9630.17
Add New /wp-admin/post-new.php?post_type=powerbi4,1694.9496.8041.73

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/embed-power-bi/includes/class-power-bi-schedule-resources.php+37
    Trying to access array offset on value of type bool
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • category_children
    • can_compress_scripts
    • power_bi_credentials
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 141 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=powerbi
    • > Notice in wp-content/plugins/embed-power-bi/includes/class-power-bi-oauth.php+152
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/edit.php?post_type=powerbi&page=powerbi
    • > Notice in wp-content/plugins/embed-power-bi/includes/class-power-bi-schedule-resources.php+223
    Undefined index: properties
    • > GET request to /wp-admin/edit.php?post_type=powerbi&page=powerbi
    • > Notice in wp-content/plugins/embed-power-bi/includes/class-power-bi-schedule-resources.php+223
    Trying to access array offset on value of type null

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/embed-power-bi/lib/cmb2/apigen/hook-docs.php
  • 49× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Select' not found in wp-content/plugins/embed-power-bi/lib/cmb2/includes/types/CMB2_Type_Select_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/embed-power-bi/lib/cmb2/includes/CMB2_Field.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/embed-power-bi/lib/cmb2/includes/types/CMB2_Type_Multi_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text_Date' not found in wp-content/plugins/embed-power-bi/lib/cmb2/includes/types/CMB2_Type_Text_Time.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/embed-power-bi/lib/cmb2/includes/types/CMB2_Type_Text_Date.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/embed-power-bi/lib/cmb2/includes/CMB2_hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/embed-power-bi/includes/class-power-bi-schedule-resources.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/embed-power-bi/lib/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/embed-power-bi/lib/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/embed-power-bi/lib/cmb2/includes/types/CMB2_Type_Radio.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: powerbi-embedded, powerbi, wordpress-plugin, wordpress

embed-power-bi/power-bi.php 77% from 13 tests

The main file in "Power BI Embedded for WordPress" v. 1.1.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and 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
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("embed-power-bi.php" instead of "power-bi.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
Good job! No executable or dangerous file extensions detected65,300 lines of code in 246 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
JavaScript165572,24611,747
PHP672,2116,4899,096
CSS141,2711,1645,098
JSON2004,244
Sass16300251,379
Markdown83180902
TypeScript101,195470
YAML195133
XML1428

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity19.12
▷ Minimum class complexity1.00
▷ Maximum class complexity183.00
Average method complexity3.35
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes74
▷ Abstract classes810.81%
▷ Concrete classes6689.19%
▷ Final classes00.00%
Methods574
▷ Static methods9616.72%
▷ Public methods46581.01%
▷ Protected methods9216.03%
▷ Private methods172.96%
Functions64
▷ Named functions6398.44%
▷ Anonymous functions11.56%
Constants16
▷ Global constants850.00%
▷ Class constants850.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
22 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
lib/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
lib/cmb2/apigen/theme-bootstrap/src/resources/collapsed.png0.24KB0.14KB▼ 41.77%
lib/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
lib/cmb2/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%