Plugin Directory

Changeset 2959728


Ignore:
Timestamp:
08/29/2023 08:18:52 AM (2 years ago)
Author:
urre
Message:

Preparing for version 0.7.0 release

Location:
album-cover-finder/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • album-cover-finder/trunk/albumcoverfinder.php

    r2380550 r2959728  
    44Plugin URI: http://labs.urre.me/albumcoverfinder/
    55Description: A simple plugin for finding album cover art via the LastFM API. You can set attachment, featured image and insert cover in post editor
    6 Version: 0.6.0
     6Version: 0.7.0
    77Author: Urban Sanden
    88Author URI: http://urre.me
     
    1313*/
    1414
    15 /*  Copyright 2020 Urban Sanden (email: [email protected])
     15/*  Copyright 2023 Urban Sanden (email: [email protected])
    1616
    1717    This program is free software; you can redistribute it and/or modify
     
    4646    add_action( 'init', array( $this, 'add_search_boxes' ) );
    4747
     48    add_action('admin_menu', array($this, 'add_menu'));
     49    add_action('admin_init', array($this, 'register_settings'));
     50
     51}
     52
     53public function add_menu() {
     54    add_menu_page(
     55        'Album Cover Finder Settings',
     56        'Album Cover Finder',
     57        'manage_options',
     58        'album-cover-finder-settings',
     59        array($this, 'settings_page')
     60    );
     61}
     62
     63public function register_settings() {
     64    register_setting('album-cover-finder-settings-group', 'album_cover_finder_api_key');
     65}
     66
     67public function settings_page() {
     68    ?>
     69    <div class="wrap">
     70        <h1>Album Cover Finder Settings</h1>
     71        <form method="post" action="options.php">
     72            <?php settings_fields('album-cover-finder-settings-group'); ?>
     73            <?php do_settings_sections('album-cover-finder-settings-group'); ?>
     74            <table class="form-table">
     75                <tr valign="top">
     76                    <th scope="row">Last.fm API Key</th>
     77                    <td><input type="text" name="album_cover_finder_api_key" value="<?php echo esc_attr(get_option('album_cover_finder_api_key')); ?>" /></td>
     78                </tr>
     79            </table>
     80            <?php submit_button(); ?>
     81        </form>
     82    </div>
     83    <?php
     84}
     85
     86public function get_api_key() {
     87    return get_option('album_cover_finder_api_key');
    4888}
    4989
     
    88128        'savenow'   => __('Save post to change/remove featured image', 'albumcoverfinder'),
    89129        'ajax_url'  => admin_url( 'admin-ajax.php' ),
    90         'uploadurl' => admin_url('media-upload.php')
     130        'uploadurl' => admin_url('media-upload.php'),
     131        'last_fm_api_key' => __($this->get_api_key(), 'albumcoverfinder')
    91132    );
    92133
    93     # Localize script
     134    # Localize scriptget_api_key
    94135    wp_localize_script('albumcoverfinder-admin-script', 'AlbumCoverFinderParams', $js_data);
    95136
  • album-cover-finder/trunk/js/admin.js

    r2380550 r2959728  
    102102            $('.countattachments').text(parseInt(att_count)+1+' '+AlbumCoverFinderParams.files);
    103103
    104             console.log(img_url);
    105 
    106104            // Ajax request, set post post thumbnail
    107105            $.post(
     
    180178            var encoded_artist = encodeURIComponent(artist),
    181179            encoded_album      = encodeURIComponent(album),
    182             lastfm_api_url     = 'https://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=853b3e9d9f565707e7edd6f878c3d587&artist='+encoded_artist+'&album='+encoded_album+'&format=json',
     180            lastfm_api_url     = 'https://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key='+AlbumCoverFinderParams.last_fm_api_key+'&artist='+encoded_artist+'&album='+encoded_album+'&format=json',
    183181            html               = '';
    184182
     
    206204                        $('#findalbum').val(AlbumCoverFinderParams.search);
    207205                        $('.clear').attr("disabled", false);
    208 
     206                        $('#query_album + p').hide();
    209207                    } else {
    210208                        html += '<p>'+AlbumCoverFinderParams.nofound+'</p>';
     
    219217                    $('#cover img').eq(2).remove();
    220218                    $('#findalbum').val(AlbumCoverFinderParams.search);
     219
    221220                },
    222221                error : function(e,d,f){
     222                    $('#wait').hide();
     223                    $('#query_album').after('<p>Nothing was found</p>');
    223224
    224225                },
  • album-cover-finder/trunk/readme.md

    r961744 r2959728  
    21212. Activate the plugin
    2222
     23## Add your Last.fm API key
     24
     25To use the plugin you now need to use your own [Last.fm API Key](https://www.last.fm/api/authentication). Visit the plugin settings page and add it there.
     26
     27![Settings page](https://github.com/urre/albumcoverfinder/assets/307676/5b8b6bba-013c-4548-907b-d1c54827cf97)
     28
     29
    2330## Uninstall
    24311. Deactivate plugin
  • album-cover-finder/trunk/readme.txt

    r2380550 r2959728  
    44Tags: music, albums, covers, album covers, artist, sleeves
    55Requires at least: 3.0
    6 Tested up to: 5.5.1
    7 Stable tag: 0.6.0
     6Tested up to: 6.3.0
     7Stable tag: 0.7.0
    88
    99Search for album covers, and use image as featured image, attachment or in post editor.
     
    4242== Changelog ==
    4343
     44= 0.7.0 =
     45The plugin now has a settings page where you can use your own Last.fm API Key. Fixed a thing where the spinner didn't get removed when no results where found.
     46
    4447= 0.6.0 =
    4548The plugin now works in WordPress 5.5.1
Note: See TracChangeset for help on using the changeset viewer.