78% oer-curriculum

Code Review | OER Curriculum

WordPress plugin OER Curriculum scored78%from 54 tests.

About plugin

  • Plugin page: oer-curriculum
  • Plugin version: 0.5.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.0.2
  • WordPress version: 6.3.1
  • First release: Jul 26, 2021
  • Latest release: Oct 14, 2022
  • Number of updates: 9
  • Update frequency: every 49.8 days
  • Top authors: navigationnorth (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /965 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▲0.50ms] Passed 4 tests

A check of server-side resources used by OER Curriculum
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0045.51 ▲1.56
Dashboard /wp-admin3.31 ▲0.0074.62 ▲24.80
Posts /wp-admin/edit.php3.36 ▲0.0051.50 ▲2.01
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.29 ▼1.98
Media Library /wp-admin/upload.php3.23 ▲0.0035.46 ▲0.43

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

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

Browser metrics Passed 4 tests

OER Curriculum: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▲0.151.76 ▼0.1342.04 ▼2.62
Dashboard /wp-admin2,198 ▲215.63 ▲0.0583.11 ▼6.8340.27 ▲1.36
Posts /wp-admin/edit.php2,100 ▼31.98 ▼0.0939.02 ▲0.6235.18 ▼3.68
Add New Post /wp-admin/post-new.php1,541 ▲1322.81 ▼0.31671.40 ▼17.8557.94 ▼24.38
Media Library /wp-admin/upload.php1,397 ▲34.18 ▼0.0395.70 ▼19.1943.44 ▼5.32

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • 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 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 items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/oer-curriculum/includes/popups/delete-section.php
    • > /wp-content/plugins/oer-curriculum/includes/popups/create-module.php
  • 13× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/oer-curriculum/templates/module.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/oer-curriculum/includes/oer-curriculum-resource-selector.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/oer-curriculum/includes/popups/standard-selection.php:19
    • > PHP Notice
      Undefined variable: wp_version in wp-content/plugins/oer-curriculum/includes/blocks/curriculum-featured-block/init.php on line 66
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/oer-curriculum/includes/blocks/curriculum-thumbnail-block/init.php:64
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/oer-curriculum/includes/popups/delete-author.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/oer-curriculum/templates/single-oer-curriculum.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/oer-curriculum/includes/popups/delete-module.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/oer-curriculum/templates/primary-source.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_query_var() in wp-content/plugins/oer-curriculum/templates/oer-curriculum-tag.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #2 (Additional metadata in the Add New Curriculum post), #3 (Tag settings page for managing curriculum tags), #4 (Subject Areas settings page for managing curriculum subjects)
You can look at the official readme.txt

oer-curriculum/oer-curriculum.php Passed 13 tests

The main PHP script in "OER Curriculum" version 0.5.5 is automatically included on every request by WordPress
138 characters long description:
Manage and display collections of Open Educational Resources in lesson plans or curriculums with alignment to Common Core State Standards.

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 plugin38,977 lines of code in 67 files:
LanguageFilesBlank linesComment linesLines of code
CSS162,81311414,320
SVG4009,840
PHP246417247,836
JavaScript151,2309446,133
PO File220837448
JSON510377
YAML11023

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions122
▷ Named functions11695.08%
▷ Anonymous functions64.92%
Constants14
▷ Global constants14100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.28MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/oer-curriculum-person-placeholder.png6.48KB3.38KB▼ 47.75%
includes/blocks/curriculum-featured-block/images/blockpreview.png276.75KB104.12KB▼ 62.38%
includes/blocks/curriculum-featured-block/images/bxnext.png1.14KB0.15KB▼ 86.94%
images/oercurr-settings-logo.png2.41KB1.46KB▼ 39.26%
includes/blocks/curriculum-featured-block/images/bxprev.png1.14KB0.16KB▼ 86.29%