SShortSingh.
Back to feed

How a naive regex silently logged plugin versions as WordPress core versions

0
·3 views

A developer discovered that scraping WordPress core version numbers from the update-core.php admin page could silently return wrong values, because the page also displays version numbers for pending plugin updates. A simple regex matching the first version-shaped number on the page picked up a plugin's version string, such as 1.7.11, instead of the actual WordPress core version. The bug produced no errors, making it hard to detect until someone noticed the reported version had never existed in WordPress core's release history. The recommended fix involves a three-layer approach: prioritising specific DOM selectors, falling back to keyword-anchored regex, and validating that the extracted major version number falls within the known WordPress core range of 4 to 9. The case highlights a broader principle that a successful regex match does not guarantee the matched value is semantically correct.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

How developers can apply Shopify accessibility fixes without losing theme updates

A common challenge for Shopify developers is that customizing a theme effectively forks it, meaning every future upstream update must be manually reconciled. This tension often discourages teams from making accessibility improvements to live themes, since fixes to semantic HTML and landmark structure require direct edits to Liquid templates. A proposed workflow addresses this by isolating styling and scripting changes into separate custom asset files that rarely conflict with updates, while keeping Liquid edits minimal and clearly marked. Developers are advised to tag every Liquid change with a consistent comment marker, making it easy to locate all modifications with a single search command. Maintaining a duplicate of the live theme disconnected from version control also helps preserve access to Shopify's built-in update notifications.

0
ProgrammingDEV Community ·

Knowing How Much to Trust AI Requires Hands-On Experience, Not Rules

The degree to which developers can delegate tasks to AI depends heavily on the nature of the task and the specific model being used, according to a developer's reflections on the DEV Community. Simple, low-ambiguity tasks like minor UI color changes are easier to hand off, while decisions with broad product or policy implications require active human judgment alongside AI input. Rather than applying a fixed trust formula, the author argues that developers must build intuition through repeated use of multiple AI models in real work — similar to how a manager learns to calibrate trust in a teammate. The author illustrates this with a concrete example from building KIBAKO, a board game prototyping service, where AI served as a thinking partner to explore design options but did not make final product decisions. The key takeaway is that effective AI delegation is a skill developed through practice, not a threshold defined once and applied universally.

0
ProgrammingDEV Community ·

Why 'Developer Experience' May Be the Wrong Name for a Real Business Problem

A growing argument in software engineering circles suggests that the term 'Developer Experience' inadvertently frames a critical business issue as a mere internal quality-of-life concern. Developers routinely lose productivity to slow build systems, unreliable tooling, and organizational friction, yet these problems rarely reach strategic business discussions. Executives who hear 'Developer Experience' tend to deprioritize it, even as they worry about slow delivery, declining quality, and stalled innovation — without connecting those outcomes to the same root cause. The author draws a parallel to how the term 'technical debt' transformed conversations by giving business leaders familiar language, arguing that DevEx needs similarly compelling framing. The piece contends that engineering performance should be viewed as a whole-system outcome, not something extracted from individual developers through measurement or pressure.

0
ProgrammingDEV Community ·

How to Build a Bidirectional Radar Chart with Draggable Vertices Using React

A developer has documented a React-based pattern for building an interactive SVG radar chart where vertices can be dragged directly, with changes instantly reflected in linked sliders and vice versa. The key insight is avoiding dual state management: instead of syncing two separate states, both the chart and sliders share a single source of truth via one state store and one update function. Coordinate math converts slider values (0–100) to polar coordinates, placing each axis vertex at equal angular intervals around a central point. Dragging a vertex triggers the same update function used by the sliders, eliminating the need for any explicit synchronization logic. The article, originally published in Japanese on forge.workstyle.tech, covers pointer event handling, coordinate transformation, and how the design scales across charts with varying numbers of axes.