Coder Social home page Coder Social logo

ucf / ucf-spotlights-plugin Goto Github PK

View Code? Open in Web Editor NEW
0.0 8.0 2.0 669 KB

Wordpress plugin for creating and displaying stylized spotlight content on UCF websites.

PHP 95.63% JavaScript 4.37%
wordpress-plugin wordpress ucf-cm athena-framework hacktoberfest

ucf-spotlights-plugin's Issues

Single Spotlights are publicly accessible by default

Describe the bug

Without the use of a theme that provides a custom post template for Spotlights and a third-party plugin that disables crawling of single Spotlights, Spotlights are accessible publicly (and crawled) with a blank page template.

Steps to Reproduce

n/a

Expected Behavior

Spotlights should at least be accessible to logged-in users to be able to preview their changes, but single Spotlights should not be crawled by Google or included in generated sitemaps.

Possible Fix

Ideally, this plugin should provide a fallback template for previewing single Spotlights, but ensure that it is not crawled or added to sitemaps.

We cannot set publicly_queryable=false on the Spotlight post type; see comments on #32 for more info.

Your environment:

(all)

Additional context

#32

Links surrounding spotlights must be set to display:block to show outlines correctly

The outline property will fail to wrap correctly around link-wrapped spotlights, due to links being inline elements. This results in outlines on focus not surrounding spotlights properly; in the case of square spotlights, they're not visible at all.

Examples of current focus states:

Vertical:
Screen Shot 2019-10-16 at 4 50 43 PM

Square:
Screen Shot 2019-10-16 at 4 51 15 PM

The horizontal layout is not affected since that layout doesn't have a link wrapped around it.

Add Ability to Control Styles on Spotlights

Description
Add the ability to control the styles of header text, body copy and the button.

Why it's Important
Style changes to the copy/buttons allows more creative freedom when choosing bg images, can help with readability and can improve the look of spotlights.

Possible Implementation

  • Add fields similar to the ucf-section plug.
  • Allow html in the current header, body and button fields (it's currently getting run through sanitize_text_field so it strips html).

Additional context

Link surrounding .spotlight-square has no class/is not editable; shows underline on hover

<a> tags surrounding square spotlight markup have no classes at all, making them uneditable via css in themes.

Unless a theme using square spotlights disables text-decoration: underline on the global a element, the inner spotlight's contents will always display an underline on hover.

screen shot 2017-09-29 at 2 16 12 pm

Having text-decoration: none on the wrapper link by default is probably desirable in all use cases. Additionally, having some unique class on the element will make it possible to make other link-based overrides in themes.

Fix notices

Notice: Undefined variable: singular in /wp-content/plugins/UCF-Spotlights-Plugin/includes/ucf-spotlight-posttype.php on line 221

Notice: Undefined variable: plural in /wp-content/plugins/UCF-Spotlights-Plugin/includes/ucf-spotlight-posttype.php on line 221

Notice: Undefined variable: post_type in /wp-content/plugins/UCF-Spotlights-Plugin/includes/ucf-spotlight-posttype.php on line 221

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UCF_Spotlight_Common::enqueue_styles() should not be called statically in /wordpress/wp-includes/class-wp-hook.php on line 298

Fix notices - trying to get property of non-object

Notice: Trying to get property of non-object in UCF-Spotlights-Plugin/includes/ucf-spotlight-common.php on line 39

Notice: Trying to get property of non-object in UCF-Spotlights-Plugin/includes/ucf-spotlight-common.php on line 42

Notice: Trying to get property of non-object in UCF-Spotlights-Plugin/includes/ucf-spotlight-common.php on line 43

Notice: Trying to get property of non-object in UCF-Spotlights-Plugin/includes/ucf-spotlight-common.php on line 44

Notice: Trying to get property of non-object in UCF-Spotlights-Plugin/includes/ucf-spotlight-common.php on line 45

Notice: Trying to get property of non-object in UCF-Spotlights-Plugin/includes/ucf-spotlight-common.php on line 46

Spotlight meta fields cannot be updated to empty values

Steps to reproduce:

  • Create and save a new spotlight with at least one optional meta field filled out with a value
  • Delete one optional meta field value and save
  • After saving, the previous meta field value is left intact

Allow single layouts to be overridable via unique hooks

Unless I'm missing something, it looks like the only layout hook for spotlights currently is ucf_spotlight_display, which requires you to perform fetches for any relevant post meta yourself in a theme and then add a layout override based on the spotlight's layout meta value. It would be nice if each type of spotlight had its own hook (e.g. ucf_spotlight_display_vertical) which had the spotlight's metadata passed to it out of the box.

Pre-closing of wrapper divs for horizontal spotlights should probably be added per-theme

https://github.com/UCF/UCF-Spotlights-Plugin/blob/master/includes/ucf-spotlight-common.php#L79-L84

The current horizontal spotlight layout assumes all preceding post contents will be wrapped in three wrapper divs (presumably .container, .row, and .col). This should probably be handled at the theme level as a layout override if div closures are needed--right now, the new main site will not have three wrapper divs to close, which will cause malformed markup and potential cross-browser rendering inconsistencies.

Adjust ARIA roles on Spotlight aside elements

<aside> elements generated by the 3 spotlight layouts inherit a landmark role (complementary), which requires a unique label (aria-label or aria-labelledby) to be defined when used on a page with other landmarks.

The simplest way to fix this issue would be to apply role="note" to all generated <aside>s; this will help preserve its semantics as a tangentially-related piece of content to the rest of the article, while removing the landmark navigation association with the role. This role may not be perfect for every scenario, but in most cases, we probably don't want aside content to be landmark content.

Alternatives would include adding an aria-label, and/or using role="region", though this will still result in the element having a landmark role, and we may not be able to implement labels in a meaningful backward-compatible way (for instance, existing Spotlights may have titles that are not intended for front-end consumption.)

See https://fae.disability.illinois.edu/rulesets/ROLE_7/ for more info.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.