Skip to content

ABSPATH check added#572

Merged
lloc merged 3 commits intomasterfrom
dev/feature/abspath
Feb 17, 2026
Merged

ABSPATH check added#572
lloc merged 3 commits intomasterfrom
dev/feature/abspath

Conversation

@lloc
Copy link
Owner

@lloc lloc commented Feb 17, 2026

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @lloc, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the security posture of the application by integrating ABSPATH checks across various core PHP files. This standard WordPress practice prevents unauthorized direct access to these files, ensuring they are only executed within the intended WordPress context and mitigating potential vulnerabilities.

Highlights

  • Security Enhancement: Implemented ABSPATH checks at the beginning of several PHP files to prevent direct access and ensure they are loaded within the WordPress environment.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • includes/ContentImport/ContentImporter.php
    • Added ABSPATH check to prevent direct access.
  • includes/ContentImport/Service.php
    • Added ABSPATH check to prevent direct access.
  • includes/MslsAdmin.php
    • Added ABSPATH check to prevent direct access.
  • includes/MslsAdminBar.php
    • Added ABSPATH check to prevent direct access.
  • includes/MslsBlogCollection.php
    • Added ABSPATH check to prevent direct access.
  • includes/MslsContentFilter.php
    • Added ABSPATH check to prevent direct access.
  • includes/MslsCustomColumn.php
    • Added ABSPATH check to prevent direct access.
  • includes/MslsCustomColumnTaxonomy.php
    • Added ABSPATH check to prevent direct access.
  • includes/MslsCustomFilter.php
    • Added ABSPATH check to prevent direct access.
  • includes/MslsMetaBox.php
    • Added ABSPATH check to prevent direct access.
  • includes/MslsOptions.php
    • Added ABSPATH check to prevent direct access.
  • includes/MslsOptionsTaxTerm.php
    • Added ABSPATH check to prevent direct access.
  • includes/MslsPostTag.php
    • Added ABSPATH check to prevent direct access.
  • includes/deprectated.php
    • Added ABSPATH check to prevent direct access.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Feb 17, 2026

🔍 WordPress Plugin Check Report

⚠️ Status: Passed with warnings

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
21 0 21

⚠️ Warnings (21)

📁 includes/MslsCustomFilter.php (1 warning)
📍 Line 🔖 Check 💬 Message
86 WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in Using exclusionary parameters, like post__not_in, in calls to get_posts() should be done with caution, see https://wpvip.com/documentation/performance-improvements-by-removing-usage-of-post__not_in/ for more information.
📁 includes/MslsWidget.php (1 warning)
📍 Line 🔖 Check 💬 Message
58 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_ALTERNATIVE_CONTENT_HOOK".
📁 includes/MslsAdmin.php (2 warnings)
📍 Line 🔖 Check 💬 Message
242 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_REGISTER_ACTION".
341 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_ACTION_PREFIX . $section".
📁 includes/MslsPostTag.php (2 warnings)
📍 Line 🔖 Check 💬 Message
115 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_ADD_INPUT_ACTION".
149 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_EDIT_INPUT_ACTION".
📁 includes/Component/Input/Select.php (1 warning)
📍 Line 🔖 Check 💬 Message
39 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::RENDER_FILTER".
📁 includes/MslsMain.php (1 warning)
📍 Line 🔖 Check 💬 Message
143 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_SAVE_ACTION".
📁 includes/MslsPostTagClassic.php (2 warnings)
📍 Line 🔖 Check 💬 Message
39 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_ADD_INPUT_ACTION".
71 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_EDIT_INPUT_ACTION".
📁 includes/ContentImport/ContentImporter.php (2 warnings)
📍 Line 🔖 Check 💬 Message
288 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_BEFORE_IMPORT_ACTION".
349 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_AFTER_IMPORT_ACTION".
📁 includes/MslsOutput.php (6 warnings)
📍 Line 🔖 Check 💬 Message
89 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_GET_HOOK".
118 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_ALTERNATE_LINKS_HOOK".
134 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_ALTERNATE_LINKS_DEFAULT_HOOK".
137 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_ALTERNATE_LINKS_ARR_HOOK".
150 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_NO_TRANSLATION_FOUND_HOOK".
181 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_GET_TAGS_HOOK".
📁 includes/MslsBlog.php (2 warnings)
📍 Line 🔖 Check 💬 Message
142 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_GET_PERMALINK_HOOK".
195 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::WP_ADMIN_BAR_SHOW_SITE_ICONS_HOOK".
📁 includes/Map/HrefLang.php (1 warning)
📍 Line 🔖 Check 💬 Message
69 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::MSLS_HEAD_HREFLANG_HOOK".

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

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces an important security enhancement by adding ABSPATH checks to prevent direct file access. This is a great step towards hardening the plugin.

However, the implementation appears to be incomplete. I've noticed that many other PHP files within the includes/ directory and its subdirectories are still missing this crucial security check. To ensure consistent security throughout the plugin, I strongly recommend adding the ABSPATH check to all PHP files that are not intended to be accessed directly.

A few examples of files that are still missing the check include:

  • includes/MslsMain.php
  • includes/MslsPlugin.php
  • includes/MslsOptionsPost.php
  • includes/Component/Component.php
  • includes/ContentImport/ImportLogger.php

Applying this check consistently across all relevant files will significantly improve the plugin's security posture.

@lloc lloc merged commit 1299290 into master Feb 17, 2026
6 checks passed
@lloc lloc deleted the dev/feature/abspath branch February 17, 2026 13:46
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.

1 participant

Comments