68% wp-oer

Code Review | WP OER

WordPress plugin WP OER scored 68% from 54 tests.

About plugin

  • Plugin page: wp-oer
  • Plugin version: 0.9.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Aug 16, 2017
  • Latest release: May 12, 2023
  • Number of updates: 41
  • Update frequency: every 51.1 days
  • Top authors: navigationnorth (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 6,734 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.33MB] [CPU: ▲14.99ms] Passed 4 tests

A check of server-side resources used by WP OER
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2955.07 ▲12.41
Dashboard /wp-admin3.68 ▲0.38100.97 ▲54.86
Posts /wp-admin/edit.php3.72 ▲0.3662.19 ▲14.20
Add New Post /wp-admin/post-new.php6.63 ▲0.74109.85 ▲14.11
Media Library /wp-admin/upload.php3.52 ▲0.2951.08 ▲19.22
Settings /wp-admin/edit.php?post_type=resource&page=oer_settings3.6798.10
Subject Areas /wp-admin/edit-tags.php?taxonomy=resource-subject-area&post_type=resource3.5245.39
All Resources /wp-admin/edit.php?post_type=resource3.6254.33
Grade Levels /wp-admin/edit-tags.php?taxonomy=resource-grade-level&post_type=resource3.5247.26
Import /wp-admin/edit.php?post_type=resource&page=oer_import3.5753.10
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=resource3.5247.18
Add Resource /wp-admin/post-new.php?post_type=resource6.68112.85

Server storage [IO: ▲26.67MB] [DB: ▲0.02MB] 67% from 3 tests

Input-output and database impact of this plugin
Please fix the following
  • The filesystem usage should be lower than 25MB (currently using 26.67MB)
Filesystem: 624 new files
Database: 4 new tables, 13 new options
New tables
wp_category_page
wp_oer_standard_notation
wp_oer_sub_standards
wp_oer_core_standards
New WordPress options
setup_notify
widget_recent-comments
db_upgraded
widget_theysaidso_widget
oer_use_bootstrap
oer_rewrite_rules
widget_oer_subject_area_widget
oer_setup
theysaidso_admin_options
oer_metadata_firstload
...

Browser metrics Passed 4 tests

A check of browser resources used by WP OER
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,115 ▲38016.08 ▲1.7017.76 ▲15.9242.45 ▼4.21
Dashboard /wp-admin2,338 ▲1835.98 ▲0.2999.04 ▼4.8441.74 ▼0.28
Posts /wp-admin/edit.php2,236 ▲1472.99 ▲0.9848.37 ▲3.4148.42 ▲11.03
Add New Post /wp-admin/post-new.php6,823 ▲5,30428.69 ▲5.56894.93 ▲281.1137.94 ▼9.99
Media Library /wp-admin/upload.php1,525 ▲1405.13 ▲0.9297.41 ▼0.4846.01 ▲1.50
Settings /wp-admin/edit.php?post_type=resource&page=oer_settings1,8997.89148.0073.28
Subject Areas /wp-admin/edit-tags.php?taxonomy=resource-subject-area&post_type=resource1,4332.5440.1029.30
All Resources /wp-admin/edit.php?post_type=resource1,4154.0856.3424.86
Grade Levels /wp-admin/edit-tags.php?taxonomy=resource-grade-level&post_type=resource1,4022.8349.0032.40
Import /wp-admin/edit.php?post_type=resource&page=oer_import1,3914.1254.1630.95
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=resource1,4472.6840.8429.51
Add Resource /wp-admin/post-new.php?post_type=resource3,11721.10954.2484.02

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie tables were found after uninstall: 4 tables
    • wp_oer_sub_standards
    • wp_oer_standard_notation
    • wp_oer_core_standards
    • wp_category_page
  • This plugin does not fully uninstall, leaving 11 options in the database
    • oer_use_fontawesome
    • widget_recent-comments
    • oer_rewrite_rules
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_oer_subject_area_widget
    • db_upgraded
    • oer_use_bootstrap
    • 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
Even though no errors were found, this is by no means an exhaustive test

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 fix the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-oer/oer_template/avada-search.php
    • > /wp-content/plugins/wp-oer/oer_template/search-layout.php
  • 26× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-oer/blocks/resource-block/init.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-oer/oer_template/standards.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-oer/oer_template/search.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-oer/blocks/subjects-index-block/init.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function oer_allowed_html() in wp-content/plugins/wp-oer/oer_template/single-resource-video.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-oer/oer_template/modals/standard_modal.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-oer/blocks/subject-resources-block-v2/init.php:127
    • > PHP Fatal error
      Uncaught Error: Call to undefined function oer_allowed_html() in wp-content/plugins/wp-oer/oer_template/single-resource-website.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-oer/oer_template/resource-subject-area.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function have_posts() in wp-content/plugins/wp-oer/oer_template/search-content.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% 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
5 plugin tags: teaching, learning, open educational resources, oer, education

wp-oer/open-educational-resources.php 92% from 13 tests

The main file in "WP OER" v. 0.9.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-oer.php" instead of "open-educational-resources.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin162,301 lines of code in 119 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript223,8261,83176,885
XML331852,495
PHP542,1171,71213,869
SVG12009,702
CSS181,8621758,040
PO File2352231734
HTML14316300
JSON600236
Python121340

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity34.20
▷ Minimum class complexity9.00
▷ Maximum class complexity118.00
Average method complexity4.19
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods52
▷ Static methods11.92%
▷ Public methods4688.46%
▷ Protected methods611.54%
▷ Private methods00.00%
Functions294
▷ Named functions28797.62%
▷ Anonymous functions72.38%
Constants64
▷ Global constants64100.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
148 compressed PNG files occupy 0.94MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
pdfjs/web/images/toolbarButton-download.png0.25KB0.39KB0.00%
images/plus.png0.51KB0.49KB▼ 4.59%
images/plugicon.png0.63KB0.61KB▼ 3.27%
pdfjs/web/images/secondaryToolbarButton-firstPage.png0.17KB0.27KB0.00%
pdfjs/web/images/toolbarButton-search@2x.png0.64KB1.08KB0.00%