78% cm-custom-reports

Code Review | CM Custom WordPress Reports

WordPress plugin CM Custom WordPress Reports scored 78% from 54 tests.

About plugin

  • Plugin page: cm-custom-reports
  • Plugin version: 1.1.10
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4.0-6.3
  • WordPress version: 6.3.1
  • First release: Mar 15, 2015
  • Latest release: Jul 23, 2023
  • Number of updates: 195
  • Update frequency: every 15.7 days
  • Top authors: CreativeMindsSolutions (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

400+ active / 16,045 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.95MB] [CPU: ▲4.01ms] 75% from 4 tests

An overview of server-side resources used by CM Custom WordPress Reports
It is recommended to improve the following
  • CPU: You should keep total CPU usage under 500.00ms (currently 956.25ms on /wp-admin/admin.php?page=cm-custom-reports-settings)
PageMemory (MB)CPU Time (ms)
Home /4.11 ▲0.6440.02 ▼0.72
Dashboard /wp-admin4.36 ▲1.0556.65 ▲6.30
Posts /wp-admin/edit.php4.47 ▲1.1159.50 ▲11.23
Add New Post /wp-admin/post-new.php6.95 ▲1.0695.53 ▼0.79
Media Library /wp-admin/upload.php4.28 ▲1.0448.70 ▲13.30
Reports /wp-admin/admin.php?page=cm-custom-reports4.2742.39
Settings /wp-admin/admin.php?page=cm-custom-reports-settings4.55956.25
Upgrade ➤ /wp-admin/admin.php?page=cmcr_pro4.2740.71
User Guide /wp-admin/admin.php?page=cmcr_about4.38336.45

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 223 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by CM Custom WordPress Reports
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,873 ▲11613.94 ▼0.741.72 ▼0.2241.13 ▼6.14
Dashboard /wp-admin2,282 ▲945.24 ▲0.37118.23 ▼1.2247.02 ▲5.66
Posts /wp-admin/edit.php2,143 ▲512.43 ▲0.3943.64 ▲3.8438.57 ▲3.67
Add New Post /wp-admin/post-new.php1,573 ▲3823.75 ▲0.59696.40 ▲74.7435.54 ▼18.88
Media Library /wp-admin/upload.php1,458 ▲734.70 ▲0.48104.26 ▲0.3346.63 ▲2.82
Reports /wp-admin/admin.php?page=cm-custom-reports1,2282.2434.9948.54
Settings /wp-admin/admin.php?page=cm-custom-reports-settings2,4988.0675.85141.98
Upgrade ➤ /wp-admin/admin.php?page=cmcr_pro1,4342.2740.1480.77
User Guide /wp-admin/admin.php?page=cmcr_about3,91517.72465.07201.66

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

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
Good news, no errors were detected

SRP 50% from 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
Please fix the following items
  • 18× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cm-custom-reports/package/cminds-plugin-config.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CMCR_Comments_By_Type_Report' not found in wp-content/plugins/cm-custom-reports/backend/reports/CommentsByTypeReport.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cm-custom-reports/package/views/plugin_compare_table.php:51
    • > PHP Warning
      include_once(): Failed opening 'CMCR_PLUGIN_DIRbackend/classes/SettingsViewAbstract.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/cm-custom-reports/backend/classes/SettingsView.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/cm-custom-reports/backend/classes/modules/GraphModule.php:9
    • > 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/cm-custom-reports/backend/classes/EventLogListTable.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'CMCR_Posts_By_Author_Report' not found in wp-content/plugins/cm-custom-reports/backend/reports/PostsByAuthorReport.php:2
    • > PHP Warning
      Use of undefined constant CMCR_PLUGIN_DIR - assumed 'CMCR_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/cm-custom-reports/backend/classes/SettingsView.php on line 2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/cm-custom-reports/package/views/userguide_free.php:8
    • > 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/cm-custom-reports/backend/classes/EventLogListTable.php on line 4

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 fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=cmcr_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/admin.php?page=cmcr_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.
    • > GET request to /wp-admin/admin.php?page=cmcr_about
    • > Deprecation (warning) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yX/r/aHGdUlnkmHl.js?_nc_x=Ij3Wp8lg5Kz 271 Listener added for a synchronous 'DOMSubtreeModified' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.
    • > GET request to /wp-admin/admin.php?page=cmcr_about
    • > Console-api (severe) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yX/r/aHGdUlnkmHl.js?_nc_x=Ij3Wp8lg5Kz 60:573 "ErrorUtils caught an error:\n\nCannot listen to an undefined element. [Caught in: Tried to listen to element of type click]\n\nSubsequent non-fatal errors won't be logged; see https://fburl.com/debugjs."

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: report, reports, statistics, user report, custom report

cm-custom-reports/cm-custom-reports.php Passed 13 tests

The main PHP file in "CM Custom WordPress Reports" ver. 1.1.10 adds more information about the plugin and also serves as the entry point for this plugin
112 characters long description:
Plugin displays, exports, schedules and e-mails a multitude of useful reports about your Wordpress installation.

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
Good job! No executable or dangerous file extensions detected31,719 lines of code in 136 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript463,6503,39616,276
PHP391,3007047,978
HTML28724272,934
Markdown679002,160
CSS7162541,592
SQL200717
Bourne Shell14034
JSON70028

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity39.44
▷ Minimum class complexity3.00
▷ Maximum class complexity254.00
Average method complexity3.11
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes16
▷ Abstract classes212.50%
▷ Concrete classes1487.50%
▷ Final classes00.00%
Methods300
▷ Static methods10635.33%
▷ Public methods26187.00%
▷ Protected methods3411.33%
▷ Private methods51.67%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.00%
Constants38
▷ Global constants1231.58%
▷ Class constants2668.42%
▷ Public constants26100.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
56 PNG files occupy 0.58MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
package/views/no.png0.38KB0.44KB0.00%
package/css/images/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%
package/css/images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%
backend/libs/flot/examples/background.png0.23KB0.33KB0.00%
package/CMWPPluginssuite.png33.88KB12.59KB▼ 62.83%