Code Monkey home page Code Monkey logo

startbox's Introduction

About StartBox

An incredibly powerful theme framework for WordPress. Official website: WPStartBox.com.

WebDevStudios. WordPress for big brands.

Download

Download here: startbox.zip

Installation

StartBox can be installed like any other WordPress theme, either via the built-in Theme Uploader, or by manually uploading to your server it via (s)FTP.

Important: If you use the "Repository Download" button, github will generate a file named "StartBox-master"). It is important that you rename the unzipped theme directory to "startbox", otherwise your child theme won't recognize that StartBox has been installed.

Usage

We highly recommend that you use a Child Theme instead of running StartBox directly. We've created a pretty simple StartBox Child Theme for you to modify and destroy as you see fit.

If you're looking for a more high-caliber design, we recommend one of these excellent themes.

Documentation

Full documentation can be found at http://docs.wpstartbox.com/

Bugs & Feature Requests

Please open an Issue to report any bugs or feature requests.

Support

Official support forums can be found at http://wpstartbox.com/support/

Contributing

Want to contribute? That's great! Patches are always welcome. Open an Issue and make a Pull Request.

  1. Open an Issue (or claim an open Issue).
  2. Fork StartBox.
  3. Create a branch (git checkout -b MyBox).
  4. Commit your changes (git commit -am "Added the best feature ever!").
  5. Push to the branch (git push origin MyBox).
  6. Open a Pull Request.
  7. Enjoy a refreshing beverage and wait.

startbox's People

Contributors

brianfields avatar brichards avatar ccschmitz avatar garyjones avatar gregrickaby avatar jtsternberg avatar koncept-web avatar lswilson avatar markjaquith avatar pypeline avatar tw2113 avatar williamsba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

startbox's Issues

Can't use custom sidebars to override Primary and Secondary at the same time

To reproduce:
-Use a layout allowing both Primary and Secondary sidebars to show.
-Add widgets to both Primary and Secondary sidebars.
-Create two custom sidebars, one to replace primary and one to replace secondary.
-Secondary is not replaced.

I think it may be in the check for which sidebars to output about line 285 of sidebars.php.

Slideshow adding random slides to beginning of slideshow

Hello,

In Wordpress 5.1, the slideshow page will add a random slide to the beginning of the sildeshow when updating.

Fixed by changing line 330 of /includes/extensions/startbox-slideshows/startbox-slideshows.php from

if( $slide['attachment_id'] == $attachment->ID ) {

to

if(( $slide['attachment_id'] == $attachment->ID )&&($slide['order'] != "")) {

This is also described here:

http://wpstartbox.com/support/topic/problem-with-starbox-slideshow/

Upgrade Killed Site

I upgraded through the Wordpress dashboard and the upgrade entirely killed my site.

Error:
Fatal error: Call to undefined function wp_get_image_editor() in /home/dusing/public_html/michael/wp-content/themes/startbox/includes/functions/images.php on line 188

Then I replaced the startbox folder with an older version and wp wouldn't let me in to the backend at all. Backing up files before trying your solution of deleting the startbox folder entirely to get in.

Use ARIA roles, states and properties

Use WAI-ARIA roles, states and properties within any markup that SB provides that may be used in child themes to make those bits more accessible to assistive user agents

One example would be to apply landmark roles to main or sidebar sections of content, search or general forms, navigation, header etc. to allow recognition of those landmarks and provide easy navigation between those sections.

States and Properties may be applied later on.

Theme options won't save if /startbox/ dir is named any differently

Currently using startbox on a few different sites, and the theme options are working from some of my old installs of startbox, but any new install, the theme options won't save.

Example:

As I look at the fresh install, the first thing I try to change is going from excerpts on the main page to full posts,
but as I hit save, it won't keep the option on full post.

I have troubleshooted by using old downloads, or fresh installs of WP. It doesn't make sense!

Default Image changed

I have a default post image set in the theme options. I then uploaded an image to the media library and did not attach the image to any post or page.

The newly uploaded image is now set as the "default post image", but not in the theme options. The theme option shows the correct default image, but the theme is not using that one.

Header typography

Suggest changing default line heights to 1.2em with padding top and bottom at 1em to achieve the same spacing effect. Multiline headings get really unsightly.

Code quality suggestions

Review of https://github.com/WebDevStudios/StartBox/blob/2.7/includes/admin/admin.php - a file picked at random in the 2.7 branch.

(Tip: If going through and fixing bits mentioned here, start at the bottom - it will keep line references intact.)

Line 1: No file-level documentation. An example for the top of each file would be:

/**
 * StartBox Framework
 * 
 * @package WebDevStudios\StartBox
 * @author  Brian Richards <[email protected]>
 * @license GPL-2.0+
 * @link    http://wpstartbox.com/
 */

3 (and throughout): End short descriptions, long descriptions and descriptions for tags with a full stop. When these strings are pulled out by a documentation generator, it'll read better.

6 (and throughout): No documentation of @global $sb_admin Admin page hook suffix.. Other globals also not documented.

13: Coding standards whitespace (CSWS), unnecessary use of double-quotes for a string, string not internationalized, line extends past 120 characters.
Whitespace inconsistency means grepping through the codebase is trickier.
Double-quotes means the string is parsed twice by PHP to resolve any variables that might be included.
Options string is not made available for translation.
Line length greater than 120 isn't part of the WP coding standards, but a general good practice. Splitting up the arguments on to their own lines also means they can be documented easier:

$sb_admin = add_theme_page(
    THEME_NAME . __( ' Options', 'startbox' ), // Page title
    __( 'Theme Options', 'startbox' ),         // Menu title
    'edit_theme_options',                      // Capability
    'sb_admin',                                // Menu slug
    'sb_admin_page'                            // Callback function
);

16 (and throughout): CSWS. Use PHP CodeSniffer with the WP sniffs to automatically generate a report of issues to be fixed. You may like to try something like WP-PhpTidy that can help fix some coding standards issues automatically too.

23: Hooked in functions don't need to be defined before the corresponding add_*() call - that means you can move the add_*() calls to just above the documentation - if you've got a particularly long function, then all of the important bits (where the function is being hooked into, and documentation for the function) are all together, which makes it easier for folks not familiar with the code to follow.

28: All version numbers should contain three digits, so 2.4.0 and not 2.4. Apart from being a WP coding standard, it also means you can grep the code for functions that were added at exactly 2.4, and not have 2.4.1 et al included. @since tags should be on each and every function.

32: When passing in an array with more than one or two values, consider assigning it to a variable first. While the creation of a variable does use a little more memory (neglible compared to the existing amount of memory used for a request), it does make the code easier to read (avoids long line lengths, can be documented) and makes it easier to debug (can var_dump() the array to check what it is populated with. Also, include a trailing comma on the last array item, so then extra items can be added without having to remember to add the comma, or lines can be re-arranged without having to fix commas as well. Lining up the => with spaces does make the code easier to read as well. This, in this case, make it easy to see that there's some CSWS issues for the title value`.

$args = array(
    'id'     => 'theme-options',
    'parent' => 'appearance',
    'title'  => __('Theme Options', 'startbox'),
    'href'   => admin_url( 'themes.php?page=sb_admin' )
);
$wp_admin_bar->add_menu( $args );

Note that since WP 3.3, the Admin Bar is replaced with the toolbar and the preferred way to add items to the toolbar is with add_node().

45: sb_admin_help() has a lot of unnecessary nesting. If this codebase is still supporting pre WP 3.3, and as this function does nothing for earlier versions, consider moving the version check up to around line 20 so that the function isn't even hooked in.

49: Inconsistent coding style, which has lead to incorrect indentation for everything below in the function. While optional braces are indeed optional within WPCS, I'm currently prefering them since adding extra lines into the body of the conditional doesn't mean odd behaviour if the braces are not added, and it also stays in line with PSR-2:

if ( $screen->id != $sb_admin ) {
    return;
}

53: A database call via get_option() is assigned to $defaults and $theme_options, yet these variables don't appear to be then used.

58-60: Lines aligned with tabs not spaces. Since tabs can vary in width, this will make alignment in diffs look wrong, or on other systems. Just add the usual one space after the longest key, then line all other => up with that.

60: While it's usually OK to include basic markup within internationalized strings, here, you've got a string at the beginning of line 60 which is almost the same as the one on line 59 - this creates two entries which translators must add translations for. Try to minimize un-needed variations.
Line 60 has a line length of over 470 columns. Since you're using sprintf(), split the arguments on to individual lines:

'content'   => '<h3>' . __( 'Additional Resources', 'startbox' ) . '</h3><p>' . sprintf(
    __( 'For more information, try the %s or %s.', 'startbox' ),
    '<a href="' . apply_filters( 'sb_theme_docs', 'http://docs.wpstartbox.com' ) . '" target="_blank">' . __( 'Theme Documentation', 'startbox') . '</a>', 
    '<a href="' . apply_filters( 'sb_theme_support', 'http://wpstartbox.com/support/' ) . '" target="_blank" >' . __( 'Support Forum', 'startbox' ) . '</a>'
) . '</p>',

This still leaves lines of over 160 columns, so I'd then look at refactorising the link markup. You may want the links (with filtered URLs and internationalized link content) to be used elsewhere, so consider putting these into handy little functions - smaller code blocks also make it easy to see where values have not been escaped too:

/**
 * Get markup for theme documentation link.
 *
 * The URL is filtered with 'sb_theme_docs' to allow pointing to non-English versions.
 *
 * @since 2.7.0
 *
 * @return string Anchor markup.
 */
function sb_get_theme_documentation_link() {
    $url = apply_filters( 'sb_theme_docs', 'http://docs.wpstartbox.com/' )
    return '<a href="' . esc_url( $url ) . '" target="_blank">' . __( 'Theme Documentation', 'startbox') . '</a>';
}

/**
 * Get markup for theme support link.
 *
 * The URL is filtered with 'sb_theme_support' to allow pointing to non-English versions.
 *
 * @since 2.7.0
 *
 * @return string Anchor markup.
 */
function sb_get_theme_support_link() {
    $url = apply_filters( 'sb_theme_support', 'http://wpstartbox.com/support/' )
    return '<a href="' . esc_url( $url ) . '" target="_blank">' . __( 'Support Forum', 'startbox') . '</a>';
}

Then:

'content'   => '<h3>' . __( 'Additional Resources', 'startbox' ) . '</h3><p>' . sprintf(
    __( 'For more information, try the %s or %s.', 'startbox' ),
    sb_get_theme_documentation_link(), 
    sb_get_theme_support_link()
) . '</p>',

...which I think is far easier to read.

67: Instead of nesting all of a loop within a conditional, consider checking for the opposite and using continue;:

foreach ( $settings as $setting ) {
    if ( ! isset( $setting->description ) ) {
        continue;
    }
    // ... now anything below here is known to have a description set, without having to be nested and indented.
}

68: No need to assign an empty string when the next line immediately concats another string to it.

76 (and throughout): Avoid the style attribute at all costs. You're already enqueuing admin style sheet, so set a class here and move the CSS to .css. Developers can then enqueue their own style sheet which cascades over your styles, without having to resort to !important.

85-87: With the version compared removed / moved elsewhere, incorrect indentation fixed from line 49, and early return from line 67, there shouldn't be a need to comment } since there shouldn't be a collection of them on several consecutive lines. Adding comments like this doesn't actually make things clearer, since most developers would use an IDE than can highlight matching braces anyway, and it's really a code smell that there's something wrong with how the code is written.

91: No function-level documentation. As well as helping with a documentation generator (e.g. phpDocumentor), function-level documentation can also be used by IDEs - In NetBeans for instance, you can hold Ctrl and hover over a function call and it will show the documention as a tooltip without having to go find it in some obscure file.

104-105: Include version numbers on enqueued scripts, so that caches can be busted when a new version of SB / the script is released. Also, be explicit about dependencies. Presumably jquery-colorpicker depends on jquery, but this isn't given. Don't presume that just because other WP scripts have been enqueued just before, that someone hasn't dequeued them which means that jQuery might not have been referenced by the time it gets to your custom JS.

118: Another line with an inconsistent coding style, including multiple statements on one line. Consider using add_query_arg() to formulate the URL.

122: The first line of a DocBlock is a short description used to summarise what the function does, so leave credit and so on to a long description, or a @link tag.

133: Inconsistent spacing between functions.

140: The { should be the last character on a function foobar() { line - certainly not pulling global variables into scope then closing PHP.

145: Use get_admin_page_title() (uses the value from line 13) instead of redefining what the page title should be.

148: No need to compare something about being == true, since being true is what the conditional is all about. If you wanted to be specific about the value, then compare against a string, not a boolean.

153: Pull the PHP part of this line out to stand alone, and assign to a variable, then add that variable as part of the markup, to avoid multiple statements and logic on one line of what is basically a HTML view.

171: Comment suggests the postbox-container is closed here, but the div doesn't have a class of postbox-container.

186: More styles to be moved into the style sheet.

187-188: Use the submit_button() function for creating submit / reset buttons.

202: Use yoda conditions to avoid accidentally assigning a string to a variable instead of comparing against it.

210: Comment lines can be split into two or more lines to avoid long lines.

211: Only checking against a type of text may miss some of the HTML5 input types. Instead of checking against each string, create an array of types and use in_array() to check if this part of the conditional should be true.

212: Don't have ternary comparisons or other conditional logic as function call arguments as it makes the code harder to read. Do the logic, assign to a variable, then use that variable.

217: In an edge case, where there are no settings, or certain conditions fail, this line will throw a notice / warning as $inputs will not be defined.

219: Add a single blank line at the end of the file - it's what WP core files do, and PSR-2 coding style says to do.

Custom sidebars don't check for sidebar post type before applying default slug, and also could end up with the same default slug on multiple posts.

I was going to put in a pull request for it but my current one is still open. This checks for the sidebar post type (I've had other CPT of mine end up with 'custom-sidebar' as their slug) and also adds the ID onto the end of the "custom-sidebar" default slug.

at line 70 in /includes/extensions/sidebars.php

// Make sure this isn't an unsaved post (auto-draft) and is a custon sidebar post if ( 'auto-draft' != $postarr['post_status'] && 'sidebar' == $data['post_type'] && '' == $data['post_name'] ) { $data['post_name'] = 'custom-sidebar-'.$postarr['ID']; }

Lost sidebars

I just upgraded to version 2.7.1 and I lost the primary sidebar for every page. Everything was working fine with the 2.7 upgrade.

Special characters (e.g. &rarr; ) break theme options.

Some special characters will break the entirety of the theme options array when saved. This is a known issue for the → character, which is currently used for the Read More option in Content Settings. It's a most unfortunate bug.

A likely fix is handling the encoding/decoding of characters on save.

Enhancement: Add extra filter in sb_nav_menu

sb_nav_menu has 2 filters in it: sb_nav_menu_defaults and sb_{$menu_id}_menu.

the second one seems relatively useless because just returns all of the html for the menu.

My main point is to add a filter immediately after the first one, sb_nav_menu_defaults (line 41 in includes/functions/menus.php). Currently, you can filter defaults but there's no way to target a specific menu (which is what I had wanted to do).

All that would be needed is this:
$r = apply_filters( "sb_nav_menu_args", $r );
just after the sb_nav_menu_defaults filter and you have access to all of a menu's arguments before they get created by wp_nav_menu. My use for this was adding separators between menu items on just 1 of my 3 menus.

Sidenote, I don't know if it's proper etiquette to just submit a pull request or to ask about it here first. I'd be happy to submit the pull if this is a thumbs up.

Blank Read More in Featured Content is returning an ellipsis

I'd say this is a very esoteric issue, but, here's how to summon this:

  1. Create a Featured Content Widget
  2. Set the 'Limit Content to ____ characters" field to any non-zero value
  3. Leave "Read More Text:" blank
  4. Widget returns an ellipsis on every post that has no text content of any sort (such as a gallery post). See attachements.
    widget-settings
    widget-output

Widget sidebar woes

More a note than an actual issue. I bet 1449747 probably broke the widget sidebars for people. Widget IDs/names/whatevs were renamed. Something to keep in mind if others bring it up.

have_posts() needs to be checked before the_post() usage

On empty archive pages, I get debug errors:
Notice: Undefined offset: 0 in /wp-includes/query.php on line 2844
Notice: Trying to get property of non-object in /wp-includes/query.php on line 3687
Notice: Trying to get property of non-object in /wp-includes/query.php on line 3689
Notice: Trying to get property of non-object in /wp-includes/query.php on line 3691
Notice: Trying to get property of non-object in /wp-includes/query.php on line 3692
Notice: Trying to get property of non-object in /wp-includes/query.php on line 3699
Notice: Trying to get property of non-object in /wp-includes/query.php on line 3734

Upgrade to 2.7.1 Breaks Slideshows and Removes Widgets

Happened with an automatic upgrade from 2.6 on my site, http://www.karks.com/

The slideshow shows up on the page, but is blank (links still work). In the admin, all images are blank.

For widgets, they were all moved to an inactive area, but all data was saved.

I went back to 2.6 to restore the slideshows. Hope this helps!

Refactor sb_get_layout()

Line 49 has an unnecessary redeclaration of global $wp_query;
Line 51 is checking for a potentially unset index (use $layout = isset( $term->meta['layout'] ) ? $term->meta['layout'] : ''; instead)

Custom sidebar won't save widgets properly if given a numeric Title/Slug

I discovered this because I forgot to add a title to a newly created custom sidebar, which meant the slug was the ID instead of a slug-itized version of the title. I also tested by creating a sidebar with the title "12354" and had the same issue.

Problem:
Widgets dragged into the custom sidebar area will disappear once the Widgets page is left or refreshed. The widget may still show on the front end through multiple refreshes (it varied from a live site to my dev).

To reproduce:
-Create new custom sidebar, give it no title or numeric title. Set it to appear on any pages/posts
-Drag text widget into newly created widget area. Put dummy text in it and save it
-View page where widget should be to confirm it displays on front end
-Refresh or return to Widgets page and text widget will now be gone.

I could correct the issue by changing the Sidebar slug, but I had to save/update from the Edit page (not via quick edit) to get the "display on" settings working right again.

Comment forms don't respect the "show avatars" setting in Discussion

All you need is a check for get_option('show_avatars') in 2 places, the form for filling out a comment and the form for displaying a comment.

As of SB 2.7.1 in /includes/functions/comment_format.php you'll want to put this check about lines 69 (just before echo get_avatar...) and 113 (just before the $avatar_ variables start getting defined). In the second instance, you'll either have to set $avatar to blank or do an else where you just echo the element. Or something else I didn't think of.

Remove colorbox as a dependency for startbox.js

Right now, several JS files are being loaded as dependencies for startbox.js.
The one that stands out to me as needing to be optional is colorbox. Not all installations will need colorbox.

wp_title filtering and SEO

If a person has WP SEO or some other plugin installed, are we ensuring at all that those plugins take priority in the end? or are there cases where StartBox would maybe be the last filtered? If I were using both, I'd expect the SEO plugin to come out on top.

Media Upload saves to incorrect folder

Media uploads are set to be organized by month and year folders under Settings » Media, but when I upload an image, it gets saved to the oldest dated folder in my uploads directory. Tried deactivating all plug-ins and re-named the plugins folder and still got the same behavior. Setting my theme to Twenty Twelve resolved the issue — uploads saved to the current month's folder. Setting theme back to Startbox with no plugins resulted in media being saved to oldest folder again.

Slideshows Don't Work in Multisite Installs

Seems like there is a bug with the slideshow in Mutlisite installs. The first site I install in the network, the slideshows work great. Every site after that in the network refuses to display the slideshow when I use the "" code.

The source code of the slideshow appears in the page, but it does not display. I've had this happen to at least 2 Multisite installs on different servers.

YourWebsite(Optional) submits as a URL

…if someone posts a comment without making the field active, like, in iOS when someone only taps in their name and email but then taps the submit button. Also happens in desktop Chrome.

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.