MTG Utilities: Overview

MTG Utilities is a plugin for WordPress that consists of three major functions to assist and enhance your blog:

  • Card links and images, using [ card ] [ /card ]
  • Deck lists, using [ deck ] [ /deck ]
  • Mana symbols, using [ mana ] [ /mana ]

Last updated 2022-04-01 v2.2
DOWNLOAD Plugin from WordPress.org

Default URL to card database query:
https://scryfall.com/search?as=grid&order=name&q=!"
Default URL to card image query:
http://gatherer.wizards.com/Handlers/Image.ashx?type=card&name=

For more information, instructions, and examples about the MTG Utilities plugin for WordPress, please read the following posts:

Spread the love

25 thoughts on “MTG Utilities: Overview”

  1. Hi,
    I am building a woocommerce mtg cards store.
    I was looking to replace mana symbols in this format :
    {R}
    to images. Is there a way to alter this plugin so it can work in that input format. The text is extracted from post_excerpt (short description).
    If you can let me know I will be more than happy to use the plugin.
    I appreciate any input.
    Fernando

    1. It may be possible, if they were treated as Smileys. I'll have to research how WordPress handles custom Smileys.

      If not, might have to brute-force search and replace entire posts. Of course, this feature should be opt-in. In case it may break the site.

      One idea is to transform curly brackets into mana tags: [ mana ] [ /mana ] ; prior to rendering the shortcodes.

  2. Hi man, i don't understand what problem i have, but from the update i no longer have the tags for the cards , and only one card is shown in decks table. Now i use other, but yours is really better so... i need to reinstall the plug?
    Best regards,

      1. Hi man, so i tried to uninstall and reinstall the plug but the error is still there. I also turned off all other magic plugins. To be clear, on whatever card name you pass the cursor always appears the card Struggle / Survive. Than, if you click on, it takes you to the scryfall home with all the cards.

        In the installed plugins screen, regarding mtg utilities this message appears:

        Questo plugin ha generato 166 caratteri di output inattesi durante l'attivazione. Se noti dei messaggi di “headers already sent”, problemi coi feed o altri tipi di problematiche, prova a disattivare o rimuovere questo plugin.

        Finally, this is my plug in editor txt:

        post_content;

        /**
        * Filter the ads.txt content.
        *
        * @since 1.2.0
        *
        * @param type $adstxt The existing ads.txt content.
        */
        echo esc_html( apply_filters( 'ads_txt_content', $adstxt ) );
        die();
        }
        } elseif ( '/app-ads.txt' === $request ) {
        $post_id = get_option( APP_ADS_TXT_MANAGER_POST_OPTION );

        // Will fall through if no option found, likely to a 404.
        if ( ! empty( $post_id ) ) {
        $post = get_post( $post_id );

        if ( ! $post instanceof WP_Post ) {
        return;
        }

        header( 'Content-Type: text/plain' );
        $adstxt = $post->post_content;

        /**
        * Filter the app-ads.txt content.
        *
        * @since 1.3.0
        *
        * @param type $app_adstxt The existing ads.txt content.
        */
        echo esc_html( apply_filters( 'app_ads_txt_content', $adstxt ) );
        die();
        }
        }
        }
        add_action( 'init', 'tenup_display_ads_txt' );

        /**
        * Add custom capabilities.
        *
        * @return void
        */
        function add_adstxt_capabilities() {
        $role = get_role( 'administrator' );
        if ( ! $role->has_cap( ADS_TXT_MANAGE_CAPABILITY ) ) {
        $role->add_cap( ADS_TXT_MANAGE_CAPABILITY );
        }
        }
        add_action( 'admin_init', 'add_adstxt_capabilities' );
        register_activation_hook( __FILE__, 'add_adstxt_capabilities' );

        /**
        * Remove custom capabilities when deactivating the plugin.
        *
        * @return void
        */
        function remove_adstxt_capabilities() {
        $role = get_role( 'administrator' );
        $role->remove_cap( ADS_TXT_MANAGE_CAPABILITY );
        }
        register_deactivation_hook( __FILE__, 'remove_adstxt_capabilities' );

        /**
        * Add a query var to detect when ads.txt has been saved.
        *
        * @param array $qvars Array of query vars.
        *
        * @return array Array of query vars.
        */
        function tenup_ads_txt_add_query_vars( $qvars ) {
        $qvars[] = 'ads_txt_saved';
        return $qvars;
        }
        add_filter( 'query_vars', 'tenup_ads_txt_add_query_vars' );

        1. this seems like you have a plugin for Ads. that may interfere. can you disable it and see if MTG Utilities works again?

          what is name of Ads plugin you use?

          1. Ads.txt Manager

            if you were referring to this with your question, do you think we can disable it?

            I'm not an expert in this sector at all, and i use this cause i guess when we created the blog it was the recommended one.

            In any case thanks for your advice!

          2. All plug that could maybe give problems

            Advanced Editor Tools (già conosciuto come TinyMCE Advanced)

            Akismet Anti-Spam

            Central Color Palette
            Classic Editor

        2. from the errors you posted, it seems most likely the problem is with the Ads.txt plugin.

          The basic steps to see if MTG Utilities is the problem or another plugin, first disable all plugins. Then enable one by one, testing your site after enabling each one.

          So, after you disable all plugins, the first plugin you enable is MTG Utilities. Then test your site with decks and cards. If it works and everything looks good, then likely another plugin is causing problems.

          1. Sigh...we tried but still nothing. On Monday we will try to get a programmer friend of ours to work on it.
            We'll let you know how the situation evolves... not being able to use your Plug anymore would be a real shame.

  3. I am using the [ ] tags and the [/]
    But when I post all I get is the text only part and no hover images of card names. I installed directly through WordPress and wondering if you have to edit any of the files to include the links that were given under installation tab on WordPress for the utility?

  4. Hi, I want to use your plugin and I would like to get my card info query url and card image query urls to pull from gatherer.wizards.com. How do if figure out what urls to use?

    1. gatherer has obtuse, unfriendly, unintuitive query format not suitable for third party (or even second party) usage. so can't help you there and why i do not use them.

      their image URL format is also shown in my installation instructions, as follows:
      http://gatherer.wizards.com/Handlers/Image.ashx?type=card&name=

    1. Hi,

      First off, thanks for all of your work on this plugin. The features and flexibility are fantastic!

      However, I'm having some difficulty getting all of the functionality to work. I installed your plugin via the plugin management page on my WordPress Admin.

      First, I had to copy the default decklist parser regex into the decklist regex field in order to get my decklists to render properly.

      Second, the mouse over card image popups aren't working. I'm confident that I've configured the image URL correctly, as the card image will be rendered if I use the image=1 attribute. The anchor link gets generated just fine, but no pop up.

      I would greatly appreciate your assistance on these issues, and I would like to say thanks again for your work on the plugin. Even with the bugs, it is an invaluable tool for my new blog.

      Thanks!

      1. card popup requires javascript.

        1. check that this file "autocard_mtg.user.js" is in plugins/mtgutil/ folder (not subfolder).
        2. check your browser allows scripts to run on your site. (i.e. let noscript allow scripts to run on your site)
        3. test on various browsers. which ones work or don't work.
  5. v1.4
    added colorless mana: c
    added energy counter (mana): e
    changed old chaos symbol to 'h'
    added 'image' toggle option to card tag : [ card image=1]

    v1.3
    autocard_mtg.js updated to 1.58

  6. v1.2.1
    fixed decklists in comments have bad card links
    added mana symbols: i(nfinite), c(haos), p(laneswalk), y, z
    changed old 'p' symbol to 2/p and p/2

    1. AFAIK the plugin is completed. click on the Download plugin link. click on the "MTG utilities" tag to see other posts about the plugin. I will update this post and put in direct links to the other posts.

      Are you asking about extra features? If so, what exactly do you have in mind?

Leave a Reply

Your email address will not be published.

*