Skip to content

build: Remove outdated sphinx-contentui package#126

Merged
MaferMazu merged 5 commits intomainfrom
sarina/remove-scui
Apr 10, 2026
Merged

build: Remove outdated sphinx-contentui package#126
MaferMazu merged 5 commits intomainfrom
sarina/remove-scui

Conversation

@sarina
Copy link
Copy Markdown
Contributor

@sarina sarina commented Apr 8, 2026

Remove sphinx-contentui package

See openedx/docs.openedx.org#1417

This is an outdated package that was included in the docs cookie cutter. It can cause build errors and doesn't seem to be used.

Add php file security

Resolves test failures like this:

image

This is a WordPress security standard enforced by many plugin review tools (like the WordPress Plugin Checker). Here's what's going on:

The problem

The file openedx-commerce-public-display.php is a PHP partial — it's meant to be included by another PHP file, not accessed directly via a URL. But without a guard, someone could potentially navigate to it directly in a browser, like:

https://yoursite.com/wp-content/plugins/openedx-commerce/public/partials/openedx-commerce-public-display.php

Accessing a partial directly could expose PHP errors, partial HTML output, or unintended behavior.

What ABSPATH is

ABSPATH is a WordPress constant defined early in WordPress's bootstrap process (wp-load.php). It holds the absolute filesystem path to the WordPress installation root.

If a file is loaded through the normal WordPress request lifecycle, ABSPATH will already be defined. If someone hits the file directly, WordPress never bootstrapped, so ABSPATH is not defined.

The fix

Add this at the very top of the file (line 1, before any HTML or PHP output):

<?php
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

This says: "If WordPress hasn't loaded yet, stop execution immediately."

Where exactly to add it

Looking at [that file on GitHub](https://github.com/openedx/openedx-wordpress-ecommerce/blob/main/public/partials/openedx-commerce-public-display.php), it likely opens with a PHP tag or HTML. The guard should go at the very top, before anything else renders.

This is a low-effort, high-value security hardening step — it's a best practice for any PHP file in a WordPress plugin that isn't meant to be a standalone entry point.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

@sarina
Copy link
Copy Markdown
Contributor Author

sarina commented Apr 8, 2026

@feanil trying to remove this package everywhere but I think there's deeper issues here (it's saying I'm upgrading from Py 3.8 -> Py 3.12) - should I just close this until the packages are upgraded?

@feanil
Copy link
Copy Markdown
Contributor

feanil commented Apr 9, 2026

Python is only used for the docs in this repo so it should be safe to upgrade to python 3.12, you just need to also update the .readthedocs.yml file to match the new version.

@sarina sarina force-pushed the sarina/remove-scui branch from 66bbbb0 to b766e60 Compare April 9, 2026 22:46
@sarina
Copy link
Copy Markdown
Contributor Author

sarina commented Apr 9, 2026

wasted some tokens to get validation from claude 🥲

image

@sarina sarina requested a review from MaferMazu April 9, 2026 22:47
Copy link
Copy Markdown
Contributor

@MaferMazu MaferMazu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this change @sarina ✨ Btw, loving your prompts 😅

@MaferMazu MaferMazu merged commit 0d8ab40 into main Apr 10, 2026
6 checks passed
@MaferMazu MaferMazu deleted the sarina/remove-scui branch April 10, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants